@langgraph-js/ui 1.7.1 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,7 +6,7 @@ var wT=Object.defineProperty;var _T=(e,t,n)=>t in e?wT(e,t,{enumerable:!0,config
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var vv;function ST(){if(vv)return kl;vv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,l){var o=null;if(l!==void 0&&(o=""+l),s.key!==void 0&&(o=""+s.key),"key"in s){l={};for(var c in s)c!=="key"&&(l[c]=s[c])}else l=s;return s=l.ref,{$$typeof:e,type:r,key:o,ref:s!==void 0?s:null,props:l}}return kl.Fragment=t,kl.jsx=n,kl.jsxs=n,kl}var xv;function kT(){return xv||(xv=1,bh.exports=ST()),bh.exports}var N=kT(),vh={exports:{}},El={},xh={exports:{}},wh={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* scheduler.production.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ var wT=Object.defineProperty;var _T=(e,t,n)=>t in e?wT(e,t,{enumerable:!0,config
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var wv;function ET(){return wv||(wv=1,function(e){function t(I,P){var Y=I.length;I.push(P);e:for(;0<Y;){var X=Y-1>>>1,E=I[X];if(0<s(E,P))I[X]=P,I[Y]=E,Y=X;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var P=I[0],Y=I.pop();if(Y!==P){I[0]=Y;e:for(var X=0,E=I.length,G=E>>>1;X<G;){var te=2*(X+1)-1,T=I[te],V=te+1,K=I[V];if(0>s(T,Y))V<E&&0>s(K,T)?(I[X]=K,I[V]=Y,X=V):(I[X]=T,I[te]=Y,X=te);else if(V<E&&0>s(K,Y))I[X]=K,I[V]=Y,X=V;else break e}}return P}function s(I,P){var Y=I.sortIndex-P.sortIndex;return Y!==0?Y:I.id-P.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var o=Date,c=o.now();e.unstable_now=function(){return o.now()-c}}var f=[],d=[],p=1,g=null,m=3,b=!1,x=!1,w=!1,_=!1,k=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function O(I){for(var P=n(d);P!==null;){if(P.callback===null)r(d);else if(P.startTime<=I)r(d),P.sortIndex=P.expirationTime,t(f,P);else break;P=n(d)}}function D(I){if(w=!1,O(I),!x)if(n(f)!==null)x=!0,M||(M=!0,B());else{var P=n(d);P!==null&&$(D,P.startTime-I)}}var M=!1,F=-1,L=5,U=-1;function j(){return _?!0:!(e.unstable_now()-U<L)}function H(){if(_=!1,M){var I=e.unstable_now();U=I;var P=!0;try{e:{x=!1,w&&(w=!1,A(F),F=-1),b=!0;var Y=m;try{t:{for(O(I),g=n(f);g!==null&&!(g.expirationTime>I&&j());){var X=g.callback;if(typeof X=="function"){g.callback=null,m=g.priorityLevel;var E=X(g.expirationTime<=I);if(I=e.unstable_now(),typeof E=="function"){g.callback=E,O(I),P=!0;break t}g===n(f)&&r(f),O(I)}else r(f);g=n(f)}if(g!==null)P=!0;else{var G=n(d);G!==null&&$(D,G.startTime-I),P=!1}}break e}finally{g=null,m=Y,b=!1}P=void 0}}finally{P?B():M=!1}}}var B;if(typeof S=="function")B=function(){S(H)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,R=q.port2;q.port1.onmessage=H,B=function(){R.postMessage(null)}}else B=function(){k(H,0)};function $(I,P){F=k(function(){I(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(I){I.callback=null},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_next=function(I){switch(m){case 1:case 2:case 3:var P=3;break;default:P=m}var Y=m;m=P;try{return I()}finally{m=Y}},e.unstable_requestPaint=function(){_=!0},e.unstable_runWithPriority=function(I,P){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var Y=m;m=I;try{return P()}finally{m=Y}},e.unstable_scheduleCallback=function(I,P,Y){var X=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?X+Y:X):Y=X,I){case 1:var E=-1;break;case 2:E=250;break;case 5:E=1073741823;break;case 4:E=1e4;break;default:E=5e3}return E=Y+E,I={id:p++,callback:P,priorityLevel:I,startTime:Y,expirationTime:E,sortIndex:-1},Y>X?(I.sortIndex=Y,t(d,I),n(f)===null&&I===n(d)&&(w?(A(F),F=-1):w=!0,$(D,Y-X))):(I.sortIndex=E,t(f,I),x||b||(x=!0,M||(M=!0,B()))),I},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(I){var P=m;return function(){var Y=m;m=P;try{return I.apply(this,arguments)}finally{m=Y}}}}(wh)),wh}var _v;function AT(){return _v||(_v=1,xh.exports=ET()),xh.exports}var _h={exports:{}},Ie={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* react.production.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ var wT=Object.defineProperty;var _T=(e,t,n)=>t in e?wT(e,t,{enumerable:!0,config
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var
|
|
25
|
+
*/var Sv;function TT(){if(Sv)return Ie;Sv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.iterator;function m(E){return E===null||typeof E!="object"?null:(E=g&&E[g]||E["@@iterator"],typeof E=="function"?E:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,w={};function _(E,G,te){this.props=E,this.context=G,this.refs=w,this.updater=te||b}_.prototype.isReactComponent={},_.prototype.setState=function(E,G){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,G,"setState")},_.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function k(){}k.prototype=_.prototype;function A(E,G,te){this.props=E,this.context=G,this.refs=w,this.updater=te||b}var S=A.prototype=new k;S.constructor=A,x(S,_.prototype),S.isPureReactComponent=!0;var O=Array.isArray,D={H:null,A:null,T:null,S:null,V:null},M=Object.prototype.hasOwnProperty;function F(E,G,te,T,V,K){return te=K.ref,{$$typeof:e,type:E,key:G,ref:te!==void 0?te:null,props:K}}function L(E,G){return F(E.type,G,void 0,void 0,void 0,E.props)}function U(E){return typeof E=="object"&&E!==null&&E.$$typeof===e}function j(E){var G={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(te){return G[te]})}var H=/\/+/g;function B(E,G){return typeof E=="object"&&E!==null&&E.key!=null?j(""+E.key):G.toString(36)}function q(){}function R(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(q,q):(E.status="pending",E.then(function(G){E.status==="pending"&&(E.status="fulfilled",E.value=G)},function(G){E.status==="pending"&&(E.status="rejected",E.reason=G)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function $(E,G,te,T,V){var K=typeof E;(K==="undefined"||K==="boolean")&&(E=null);var J=!1;if(E===null)J=!0;else switch(K){case"bigint":case"string":case"number":J=!0;break;case"object":switch(E.$$typeof){case e:case t:J=!0;break;case p:return J=E._init,$(J(E._payload),G,te,T,V)}}if(J)return V=V(E),J=T===""?"."+B(E,0):T,O(V)?(te="",J!=null&&(te=J.replace(H,"$&/")+"/"),$(V,G,te,"",function(ye){return ye})):V!=null&&(U(V)&&(V=L(V,te+(V.key==null||E&&E.key===V.key?"":(""+V.key).replace(H,"$&/")+"/")+J)),G.push(V)),1;J=0;var le=T===""?".":T+":";if(O(E))for(var fe=0;fe<E.length;fe++)T=E[fe],K=le+B(T,fe),J+=$(T,G,te,K,V);else if(fe=m(E),typeof fe=="function")for(E=fe.call(E),fe=0;!(T=E.next()).done;)T=T.value,K=le+B(T,fe++),J+=$(T,G,te,K,V);else if(K==="object"){if(typeof E.then=="function")return $(R(E),G,te,T,V);throw G=String(E),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return J}function I(E,G,te){if(E==null)return E;var T=[],V=0;return $(E,T,"","",function(K){return G.call(te,K,V++)}),T}function P(E){if(E._status===-1){var G=E._result;G=G(),G.then(function(te){(E._status===0||E._status===-1)&&(E._status=1,E._result=te)},function(te){(E._status===0||E._status===-1)&&(E._status=2,E._result=te)}),E._status===-1&&(E._status=0,E._result=G)}if(E._status===1)return E._result.default;throw E._result}var Y=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof E=="object"&&E!==null&&typeof E.message=="string"?String(E.message):String(E),error:E});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)};function X(){}return Ie.Children={map:I,forEach:function(E,G,te){I(E,function(){G.apply(this,arguments)},te)},count:function(E){var G=0;return I(E,function(){G++}),G},toArray:function(E){return I(E,function(G){return G})||[]},only:function(E){if(!U(E))throw Error("React.Children.only expected to receive a single React element child.");return E}},Ie.Component=_,Ie.Fragment=n,Ie.Profiler=s,Ie.PureComponent=A,Ie.StrictMode=r,Ie.Suspense=f,Ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Ie.__COMPILER_RUNTIME={__proto__:null,c:function(E){return D.H.useMemoCache(E)}},Ie.cache=function(E){return function(){return E.apply(null,arguments)}},Ie.cloneElement=function(E,G,te){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var T=x({},E.props),V=E.key,K=void 0;if(G!=null)for(J in G.ref!==void 0&&(K=void 0),G.key!==void 0&&(V=""+G.key),G)!M.call(G,J)||J==="key"||J==="__self"||J==="__source"||J==="ref"&&G.ref===void 0||(T[J]=G[J]);var J=arguments.length-2;if(J===1)T.children=te;else if(1<J){for(var le=Array(J),fe=0;fe<J;fe++)le[fe]=arguments[fe+2];T.children=le}return F(E.type,V,void 0,void 0,K,T)},Ie.createContext=function(E){return E={$$typeof:o,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:l,_context:E},E},Ie.createElement=function(E,G,te){var T,V={},K=null;if(G!=null)for(T in G.key!==void 0&&(K=""+G.key),G)M.call(G,T)&&T!=="key"&&T!=="__self"&&T!=="__source"&&(V[T]=G[T]);var J=arguments.length-2;if(J===1)V.children=te;else if(1<J){for(var le=Array(J),fe=0;fe<J;fe++)le[fe]=arguments[fe+2];V.children=le}if(E&&E.defaultProps)for(T in J=E.defaultProps,J)V[T]===void 0&&(V[T]=J[T]);return F(E,K,void 0,void 0,null,V)},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function(E){return{$$typeof:c,render:E}},Ie.isValidElement=U,Ie.lazy=function(E){return{$$typeof:p,_payload:{_status:-1,_result:E},_init:P}},Ie.memo=function(E,G){return{$$typeof:d,type:E,compare:G===void 0?null:G}},Ie.startTransition=function(E){var G=D.T,te={};D.T=te;try{var T=E(),V=D.S;V!==null&&V(te,T),typeof T=="object"&&T!==null&&typeof T.then=="function"&&T.then(X,Y)}catch(K){Y(K)}finally{D.T=G}},Ie.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Ie.use=function(E){return D.H.use(E)},Ie.useActionState=function(E,G,te){return D.H.useActionState(E,G,te)},Ie.useCallback=function(E,G){return D.H.useCallback(E,G)},Ie.useContext=function(E){return D.H.useContext(E)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function(E,G){return D.H.useDeferredValue(E,G)},Ie.useEffect=function(E,G,te){var T=D.H;if(typeof te=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return T.useEffect(E,G)},Ie.useId=function(){return D.H.useId()},Ie.useImperativeHandle=function(E,G,te){return D.H.useImperativeHandle(E,G,te)},Ie.useInsertionEffect=function(E,G){return D.H.useInsertionEffect(E,G)},Ie.useLayoutEffect=function(E,G){return D.H.useLayoutEffect(E,G)},Ie.useMemo=function(E,G){return D.H.useMemo(E,G)},Ie.useOptimistic=function(E,G){return D.H.useOptimistic(E,G)},Ie.useReducer=function(E,G,te){return D.H.useReducer(E,G,te)},Ie.useRef=function(E){return D.H.useRef(E)},Ie.useState=function(E){return D.H.useState(E)},Ie.useSyncExternalStore=function(E,G,te){return D.H.useSyncExternalStore(E,G,te)},Ie.useTransition=function(){return D.H.useTransition()},Ie.version="19.1.0",Ie}var kv;function so(){return kv||(kv=1,_h.exports=TT()),_h.exports}var Sh={exports:{}},$t={};/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.js
|
|
28
28
|
*
|
|
@@ -30,7 +30,7 @@ var wT=Object.defineProperty;var _T=(e,t,n)=>t in e?wT(e,t,{enumerable:!0,config
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var
|
|
33
|
+
*/var Ev;function NT(){if(Ev)return $t;Ev=1;var e=so();function t(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function l(f,d,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:g==null?null:""+g,children:f,containerInfo:d,implementation:p}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return $t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,$t.createPortal=function(f,d){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return l(f,d,null,p)},$t.flushSync=function(f){var d=o.T,p=r.p;try{if(o.T=null,r.p=2,f)return f()}finally{o.T=d,r.p=p,r.d.f()}},$t.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(f,d))},$t.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},$t.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var p=d.as,g=c(p,d.crossOrigin),m=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?r.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:g,integrity:m,fetchPriority:b}):p==="script"&&r.d.X(f,{crossOrigin:g,integrity:m,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},$t.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=c(d.as,d.crossOrigin);r.d.M(f,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(f)},$t.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,g=c(p,d.crossOrigin);r.d.L(f,p,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},$t.preloadModule=function(f,d){if(typeof f=="string")if(d){var p=c(d.as,d.crossOrigin);r.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(f)},$t.requestFormReset=function(f){r.d.r(f)},$t.unstable_batchedUpdates=function(f,d){return f(d)},$t.useFormState=function(f,d,p){return o.H.useFormState(f,d,p)},$t.useFormStatus=function(){return o.H.useHostTransitionStatus()},$t.version="19.1.0",$t}var Av;function A_(){if(Av)return Sh.exports;Av=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Sh.exports=NT(),Sh.exports}/**
|
|
34
34
|
* @license React
|
|
35
35
|
* react-dom-client.production.js
|
|
36
36
|
*
|
|
@@ -38,59 +38,59 @@ var wT=Object.defineProperty;var _T=(e,t,n)=>t in e?wT(e,t,{enumerable:!0,config
|
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the MIT license found in the
|
|
40
40
|
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var Av;function NT(){if(Av)return El;Av=1;var e=AT(),t=so(),n=E_();function r(i){var a="https://react.dev/errors/"+i;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)a+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+i+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function l(i){var a=i,u=i;if(i.alternate)for(;a.return;)a=a.return;else{i=a;do a=i,(a.flags&4098)!==0&&(u=a.return),i=a.return;while(i)}return a.tag===3?u:null}function o(i){if(i.tag===13){var a=i.memoizedState;if(a===null&&(i=i.alternate,i!==null&&(a=i.memoizedState)),a!==null)return a.dehydrated}return null}function c(i){if(l(i)!==i)throw Error(r(188))}function f(i){var a=i.alternate;if(!a){if(a=l(i),a===null)throw Error(r(188));return a!==i?null:i}for(var u=i,h=a;;){var y=u.return;if(y===null)break;var v=y.alternate;if(v===null){if(h=y.return,h!==null){u=h;continue}break}if(y.child===v.child){for(v=y.child;v;){if(v===u)return c(y),i;if(v===h)return c(y),a;v=v.sibling}throw Error(r(188))}if(u.return!==h.return)u=y,h=v;else{for(var N=!1,z=y.child;z;){if(z===u){N=!0,u=y,h=v;break}if(z===h){N=!0,h=y,u=v;break}z=z.sibling}if(!N){for(z=v.child;z;){if(z===u){N=!0,u=v,h=y;break}if(z===h){N=!0,h=v,u=y;break}z=z.sibling}if(!N)throw Error(r(189))}}if(u.alternate!==h)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?i:a}function d(i){var a=i.tag;if(a===5||a===26||a===27||a===6)return i;for(i=i.child;i!==null;){if(a=d(i),a!==null)return a;i=i.sibling}return null}var p=Object.assign,g=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),k=Symbol.for("react.provider"),A=Symbol.for("react.consumer"),S=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),j=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function B(i){return i===null||typeof i!="object"?null:(i=H&&i[H]||i["@@iterator"],typeof i=="function"?i:null)}var q=Symbol.for("react.client.reference");function R(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===q?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case x:return"Fragment";case _:return"Profiler";case w:return"StrictMode";case D:return"Suspense";case M:return"SuspenseList";case U:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case b:return"Portal";case S:return(i.displayName||"Context")+".Provider";case A:return(i._context.displayName||"Context")+".Consumer";case O:var a=i.render;return i=i.displayName,i||(i=a.displayName||a.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case F:return a=i.displayName||null,a!==null?a:R(i.type)||"Memo";case L:a=i._payload,i=i._init;try{return R(i(a))}catch{}}return null}var $=Array.isArray,I=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},X=[],E=-1;function G(i){return{current:i}}function te(i){0>E||(i.current=X[E],X[E]=null,E--)}function T(i,a){E++,X[E]=i.current,i.current=a}var V=G(null),K=G(null),J=G(null),le=G(null);function fe(i,a){switch(T(J,a),T(K,i),T(V,null),a.nodeType){case 9:case 11:i=(i=a.documentElement)&&(i=i.namespaceURI)?Gb(i):0;break;default:if(i=a.tagName,a=a.namespaceURI)a=Gb(a),i=Zb(a,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}te(V),T(V,i)}function ye(){te(V),te(K),te(J)}function Ae(i){i.memoizedState!==null&&T(le,i);var a=V.current,u=Zb(a,i.type);a!==u&&(T(K,i),T(V,u))}function Se(i){K.current===i&&(te(V),te(K)),le.current===i&&(te(le),vl._currentValue=Y)}var be=Object.prototype.hasOwnProperty,je=e.unstable_scheduleCallback,ze=e.unstable_cancelCallback,lt=e.unstable_shouldYield,ft=e.unstable_requestPaint,xt=e.unstable_now,Ai=e.unstable_getCurrentPriorityLevel,fr=e.unstable_ImmediatePriority,Dn=e.unstable_UserBlockingPriority,Xn=e.unstable_NormalPriority,dr=e.unstable_LowPriority,Qn=e.unstable_IdlePriority,Ti=e.log,Kn=e.unstable_setDisableYieldValue,se=null,he=null;function Ee(i){if(typeof Ti=="function"&&Kn(i),he&&typeof he.setStrictMode=="function")try{he.setStrictMode(se,i)}catch{}}var Te=Math.clz32?Math.clz32:jn,Qe=Math.log,Gt=Math.LN2;function jn(i){return i>>>=0,i===0?32:31-(Qe(i)/Gt|0)|0}var Pt=256,Sn=4194304;function Zt(i){var a=i&42;if(a!==0)return a;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function wt(i,a,u){var h=i.pendingLanes;if(h===0)return 0;var y=0,v=i.suspendedLanes,N=i.pingedLanes;i=i.warmLanes;var z=h&134217727;return z!==0?(h=z&~v,h!==0?y=Zt(h):(N&=z,N!==0?y=Zt(N):u||(u=z&~i,u!==0&&(y=Zt(u))))):(z=h&~v,z!==0?y=Zt(z):N!==0?y=Zt(N):u||(u=h&~i,u!==0&&(y=Zt(u)))),y===0?0:a!==0&&a!==y&&(a&v)===0&&(v=y&-y,u=a&-a,v>=u||v===32&&(u&4194048)!==0)?a:y}function Kt(i,a){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&a)===0}function un(i,a){switch(i){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function yo(){var i=Pt;return Pt<<=1,(Pt&4194048)===0&&(Pt=256),i}function bo(){var i=Sn;return Sn<<=1,(Sn&62914560)===0&&(Sn=4194304),i}function _s(i){for(var a=[],u=0;31>u;u++)a.push(i);return a}function Ci(i,a){i.pendingLanes|=a,a!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function uf(i,a,u,h,y,v){var N=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var z=i.entanglements,Z=i.expirationTimes,re=i.hiddenUpdates;for(u=N&~u;0<u;){var oe=31-Te(u),de=1<<oe;z[oe]=0,Z[oe]=-1;var ie=re[oe];if(ie!==null)for(re[oe]=null,oe=0;oe<ie.length;oe++){var ae=ie[oe];ae!==null&&(ae.lane&=-536870913)}u&=~de}h!==0&&Ss(i,h,0),v!==0&&y===0&&i.tag!==0&&(i.suspendedLanes|=v&~(N&~a))}function Ss(i,a,u){i.pendingLanes|=a,i.suspendedLanes&=~a;var h=31-Te(a);i.entangledLanes|=a,i.entanglements[h]=i.entanglements[h]|1073741824|u&4194090}function vo(i,a){var u=i.entangledLanes|=a;for(i=i.entanglements;u;){var h=31-Te(u),y=1<<h;y&a|i[h]&a&&(i[h]|=a),u&=~y}}function ks(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Es(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function xo(){var i=P.p;return i!==0?i:(i=window.event,i===void 0?32:dv(i.type))}function cf(i,a){var u=P.p;try{return P.p=i,a()}finally{P.p=u}}var Jn=Math.random().toString(36).slice(2),Mt="__reactFiber$"+Jn,Ut="__reactProps$"+Jn,Br="__reactContainer$"+Jn,As="__reactEvents$"+Jn,ff="__reactListeners$"+Jn,df="__reactHandles$"+Jn,wo="__reactResources$"+Jn,Ni="__reactMarker$"+Jn;function Ts(i){delete i[Mt],delete i[Ut],delete i[As],delete i[ff],delete i[df]}function hr(i){var a=i[Mt];if(a)return a;for(var u=i.parentNode;u;){if(a=u[Br]||u[Mt]){if(u=a.alternate,a.child!==null||u!==null&&u.child!==null)for(i=Kb(i);i!==null;){if(u=i[Mt])return u;i=Kb(i)}return a}i=u,u=i.parentNode}return null}function pr(i){if(i=i[Mt]||i[Br]){var a=i.tag;if(a===5||a===6||a===13||a===26||a===27||a===3)return i}return null}function Fr(i){var a=i.tag;if(a===5||a===26||a===27||a===6)return i.stateNode;throw Error(r(33))}function Pr(i){var a=i[wo];return a||(a=i[wo]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function _t(i){i[Ni]=!0}var _o=new Set,So={};function gr(i,a){Ur(i,a),Ur(i+"Capture",a)}function Ur(i,a){for(So[i]=a,i=0;i<a.length;i++)_o.add(a[i])}var ko=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Eo={},Ao={};function hf(i){return be.call(Ao,i)?!0:be.call(Eo,i)?!1:ko.test(i)?Ao[i]=!0:(Eo[i]=!0,!1)}function ua(i,a,u){if(hf(a))if(u===null)i.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(a);return;case"boolean":var h=a.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){i.removeAttribute(a);return}}i.setAttribute(a,""+u)}}function ca(i,a,u){if(u===null)i.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(a);return}i.setAttribute(a,""+u)}}function zn(i,a,u,h){if(h===null)i.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(a,u,""+h)}}var Cs,Ns;function Hr(i){if(Cs===void 0)try{throw Error()}catch(u){var a=u.stack.trim().match(/\n( *(at )?)/);Cs=a&&a[1]||"",Ns=-1<u.stack.indexOf(`
|
|
41
|
+
*/var Tv;function CT(){if(Tv)return El;Tv=1;var e=AT(),t=so(),n=A_();function r(i){var a="https://react.dev/errors/"+i;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)a+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+i+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function l(i){var a=i,u=i;if(i.alternate)for(;a.return;)a=a.return;else{i=a;do a=i,(a.flags&4098)!==0&&(u=a.return),i=a.return;while(i)}return a.tag===3?u:null}function o(i){if(i.tag===13){var a=i.memoizedState;if(a===null&&(i=i.alternate,i!==null&&(a=i.memoizedState)),a!==null)return a.dehydrated}return null}function c(i){if(l(i)!==i)throw Error(r(188))}function f(i){var a=i.alternate;if(!a){if(a=l(i),a===null)throw Error(r(188));return a!==i?null:i}for(var u=i,h=a;;){var y=u.return;if(y===null)break;var v=y.alternate;if(v===null){if(h=y.return,h!==null){u=h;continue}break}if(y.child===v.child){for(v=y.child;v;){if(v===u)return c(y),i;if(v===h)return c(y),a;v=v.sibling}throw Error(r(188))}if(u.return!==h.return)u=y,h=v;else{for(var C=!1,z=y.child;z;){if(z===u){C=!0,u=y,h=v;break}if(z===h){C=!0,h=y,u=v;break}z=z.sibling}if(!C){for(z=v.child;z;){if(z===u){C=!0,u=v,h=y;break}if(z===h){C=!0,h=v,u=y;break}z=z.sibling}if(!C)throw Error(r(189))}}if(u.alternate!==h)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?i:a}function d(i){var a=i.tag;if(a===5||a===26||a===27||a===6)return i;for(i=i.child;i!==null;){if(a=d(i),a!==null)return a;i=i.sibling}return null}var p=Object.assign,g=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),k=Symbol.for("react.provider"),A=Symbol.for("react.consumer"),S=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),j=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function B(i){return i===null||typeof i!="object"?null:(i=H&&i[H]||i["@@iterator"],typeof i=="function"?i:null)}var q=Symbol.for("react.client.reference");function R(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===q?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case x:return"Fragment";case _:return"Profiler";case w:return"StrictMode";case D:return"Suspense";case M:return"SuspenseList";case U:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case b:return"Portal";case S:return(i.displayName||"Context")+".Provider";case A:return(i._context.displayName||"Context")+".Consumer";case O:var a=i.render;return i=i.displayName,i||(i=a.displayName||a.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case F:return a=i.displayName||null,a!==null?a:R(i.type)||"Memo";case L:a=i._payload,i=i._init;try{return R(i(a))}catch{}}return null}var $=Array.isArray,I=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},X=[],E=-1;function G(i){return{current:i}}function te(i){0>E||(i.current=X[E],X[E]=null,E--)}function T(i,a){E++,X[E]=i.current,i.current=a}var V=G(null),K=G(null),J=G(null),le=G(null);function fe(i,a){switch(T(J,a),T(K,i),T(V,null),a.nodeType){case 9:case 11:i=(i=a.documentElement)&&(i=i.namespaceURI)?Zb(i):0;break;default:if(i=a.tagName,a=a.namespaceURI)a=Zb(a),i=Yb(a,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}te(V),T(V,i)}function ye(){te(V),te(K),te(J)}function Ae(i){i.memoizedState!==null&&T(le,i);var a=V.current,u=Yb(a,i.type);a!==u&&(T(K,i),T(V,u))}function Se(i){K.current===i&&(te(V),te(K)),le.current===i&&(te(le),vl._currentValue=Y)}var be=Object.prototype.hasOwnProperty,je=e.unstable_scheduleCallback,ze=e.unstable_cancelCallback,lt=e.unstable_shouldYield,ft=e.unstable_requestPaint,xt=e.unstable_now,Ai=e.unstable_getCurrentPriorityLevel,fr=e.unstable_ImmediatePriority,Dn=e.unstable_UserBlockingPriority,Xn=e.unstable_NormalPriority,dr=e.unstable_LowPriority,Qn=e.unstable_IdlePriority,Ti=e.log,Kn=e.unstable_setDisableYieldValue,se=null,he=null;function Ee(i){if(typeof Ti=="function"&&Kn(i),he&&typeof he.setStrictMode=="function")try{he.setStrictMode(se,i)}catch{}}var Te=Math.clz32?Math.clz32:jn,Qe=Math.log,Gt=Math.LN2;function jn(i){return i>>>=0,i===0?32:31-(Qe(i)/Gt|0)|0}var Pt=256,Sn=4194304;function Zt(i){var a=i&42;if(a!==0)return a;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function wt(i,a,u){var h=i.pendingLanes;if(h===0)return 0;var y=0,v=i.suspendedLanes,C=i.pingedLanes;i=i.warmLanes;var z=h&134217727;return z!==0?(h=z&~v,h!==0?y=Zt(h):(C&=z,C!==0?y=Zt(C):u||(u=z&~i,u!==0&&(y=Zt(u))))):(z=h&~v,z!==0?y=Zt(z):C!==0?y=Zt(C):u||(u=h&~i,u!==0&&(y=Zt(u)))),y===0?0:a!==0&&a!==y&&(a&v)===0&&(v=y&-y,u=a&-a,v>=u||v===32&&(u&4194048)!==0)?a:y}function Kt(i,a){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&a)===0}function un(i,a){switch(i){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function yo(){var i=Pt;return Pt<<=1,(Pt&4194048)===0&&(Pt=256),i}function bo(){var i=Sn;return Sn<<=1,(Sn&62914560)===0&&(Sn=4194304),i}function _s(i){for(var a=[],u=0;31>u;u++)a.push(i);return a}function Ni(i,a){i.pendingLanes|=a,a!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function uf(i,a,u,h,y,v){var C=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var z=i.entanglements,Z=i.expirationTimes,re=i.hiddenUpdates;for(u=C&~u;0<u;){var oe=31-Te(u),de=1<<oe;z[oe]=0,Z[oe]=-1;var ie=re[oe];if(ie!==null)for(re[oe]=null,oe=0;oe<ie.length;oe++){var ae=ie[oe];ae!==null&&(ae.lane&=-536870913)}u&=~de}h!==0&&Ss(i,h,0),v!==0&&y===0&&i.tag!==0&&(i.suspendedLanes|=v&~(C&~a))}function Ss(i,a,u){i.pendingLanes|=a,i.suspendedLanes&=~a;var h=31-Te(a);i.entangledLanes|=a,i.entanglements[h]=i.entanglements[h]|1073741824|u&4194090}function vo(i,a){var u=i.entangledLanes|=a;for(i=i.entanglements;u;){var h=31-Te(u),y=1<<h;y&a|i[h]&a&&(i[h]|=a),u&=~y}}function ks(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Es(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function xo(){var i=P.p;return i!==0?i:(i=window.event,i===void 0?32:hv(i.type))}function cf(i,a){var u=P.p;try{return P.p=i,a()}finally{P.p=u}}var Jn=Math.random().toString(36).slice(2),Mt="__reactFiber$"+Jn,Ut="__reactProps$"+Jn,Br="__reactContainer$"+Jn,As="__reactEvents$"+Jn,ff="__reactListeners$"+Jn,df="__reactHandles$"+Jn,wo="__reactResources$"+Jn,Ci="__reactMarker$"+Jn;function Ts(i){delete i[Mt],delete i[Ut],delete i[As],delete i[ff],delete i[df]}function hr(i){var a=i[Mt];if(a)return a;for(var u=i.parentNode;u;){if(a=u[Br]||u[Mt]){if(u=a.alternate,a.child!==null||u!==null&&u.child!==null)for(i=Jb(i);i!==null;){if(u=i[Mt])return u;i=Jb(i)}return a}i=u,u=i.parentNode}return null}function pr(i){if(i=i[Mt]||i[Br]){var a=i.tag;if(a===5||a===6||a===13||a===26||a===27||a===3)return i}return null}function Fr(i){var a=i.tag;if(a===5||a===26||a===27||a===6)return i.stateNode;throw Error(r(33))}function Pr(i){var a=i[wo];return a||(a=i[wo]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function _t(i){i[Ci]=!0}var _o=new Set,So={};function gr(i,a){Ur(i,a),Ur(i+"Capture",a)}function Ur(i,a){for(So[i]=a,i=0;i<a.length;i++)_o.add(a[i])}var ko=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Eo={},Ao={};function hf(i){return be.call(Ao,i)?!0:be.call(Eo,i)?!1:ko.test(i)?Ao[i]=!0:(Eo[i]=!0,!1)}function ua(i,a,u){if(hf(a))if(u===null)i.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(a);return;case"boolean":var h=a.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){i.removeAttribute(a);return}}i.setAttribute(a,""+u)}}function ca(i,a,u){if(u===null)i.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(a);return}i.setAttribute(a,""+u)}}function zn(i,a,u,h){if(h===null)i.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(a,u,""+h)}}var Ns,Cs;function Hr(i){if(Ns===void 0)try{throw Error()}catch(u){var a=u.stack.trim().match(/\n( *(at )?)/);Ns=a&&a[1]||"",Cs=-1<u.stack.indexOf(`
|
|
42
42
|
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+
|
|
43
|
+
`+Ns+i+Cs}var Os=!1;function Ms(i,a){if(!i||Os)return"";Os=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(a){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(ae){var ie=ae}Reflect.construct(i,[],de)}else{try{de.call()}catch(ae){ie=ae}i.call(de.prototype)}}else{try{throw Error()}catch(ae){ie=ae}(de=i())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(ae){if(ae&&ie&&typeof ae.stack=="string")return[ae.stack,ie.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=h.DetermineComponentFrameRoot(),C=v[0],z=v[1];if(C&&z){var Z=C.split(`
|
|
44
44
|
`),re=z.split(`
|
|
45
45
|
`);for(y=h=0;h<Z.length&&!Z[h].includes("DetermineComponentFrameRoot");)h++;for(;y<re.length&&!re[y].includes("DetermineComponentFrameRoot");)y++;if(h===Z.length||y===re.length)for(h=Z.length-1,y=re.length-1;1<=h&&0<=y&&Z[h]!==re[y];)y--;for(;1<=h&&0<=y;h--,y--)if(Z[h]!==re[y]){if(h!==1||y!==1)do if(h--,y--,0>y||Z[h]!==re[y]){var oe=`
|
|
46
46
|
`+Z[h].replace(" at new "," at ");return i.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",i.displayName)),oe}while(1<=h&&0<=y);break}}}finally{Os=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?Hr(u):""}function pf(i){switch(i.tag){case 26:case 27:case 5:return Hr(i.type);case 16:return Hr("Lazy");case 13:return Hr("Suspense");case 19:return Hr("SuspenseList");case 0:case 15:return Ms(i.type,!1);case 11:return Ms(i.type.render,!1);case 1:return Ms(i.type,!0);case 31:return Hr("Activity");default:return""}}function To(i){try{var a="";do a+=pf(i),i=i.return;while(i);return a}catch(u){return`
|
|
47
47
|
Error generating stack: `+u.message+`
|
|
48
|
-
`+u.stack}}function Jt(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Co(i){var a=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function fa(i){var a=Co(i)?"checked":"value",u=Object.getOwnPropertyDescriptor(i.constructor.prototype,a),h=""+i[a];if(!i.hasOwnProperty(a)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var y=u.get,v=u.set;return Object.defineProperty(i,a,{configurable:!0,get:function(){return y.call(this)},set:function(N){h=""+N,v.call(this,N)}}),Object.defineProperty(i,a,{enumerable:u.enumerable}),{getValue:function(){return h},setValue:function(N){h=""+N},stopTracking:function(){i._valueTracker=null,delete i[a]}}}}function da(i){i._valueTracker||(i._valueTracker=fa(i))}function No(i){if(!i)return!1;var a=i._valueTracker;if(!a)return!0;var u=a.getValue(),h="";return i&&(h=Co(i)?i.checked?"true":"false":i.value),i=h,i!==u?(a.setValue(i),!0):!1}function $r(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var gf=/[\n"\\]/g;function Wt(i){return i.replace(gf,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function ha(i,a,u,h,y,v,N,z){i.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?i.type=N:i.removeAttribute("type"),a!=null?N==="number"?(a===0&&i.value===""||i.value!=a)&&(i.value=""+Jt(a)):i.value!==""+Jt(a)&&(i.value=""+Jt(a)):N!=="submit"&&N!=="reset"||i.removeAttribute("value"),a!=null?mf(i,N,Jt(a)):u!=null?mf(i,N,Jt(u)):h!=null&&i.removeAttribute("value"),y==null&&v!=null&&(i.defaultChecked=!!v),y!=null&&(i.checked=y&&typeof y!="function"&&typeof y!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?i.name=""+Jt(z):i.removeAttribute("name")}function $m(i,a,u,h,y,v,N,z){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(i.type=v),a!=null||u!=null){if(!(v!=="submit"&&v!=="reset"||a!=null))return;u=u!=null?""+Jt(u):"",a=a!=null?""+Jt(a):u,z||a===i.value||(i.value=a),i.defaultValue=a}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,i.checked=z?i.checked:!!h,i.defaultChecked=!!h,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(i.name=N)}function mf(i,a,u){a==="number"&&$r(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function pa(i,a,u,h){if(i=i.options,a){a={};for(var y=0;y<u.length;y++)a["$"+u[y]]=!0;for(u=0;u<i.length;u++)y=a.hasOwnProperty("$"+i[u].value),i[u].selected!==y&&(i[u].selected=y),y&&h&&(i[u].defaultSelected=!0)}else{for(u=""+Jt(u),a=null,y=0;y<i.length;y++){if(i[y].value===u){i[y].selected=!0,h&&(i[y].defaultSelected=!0);return}a!==null||i[y].disabled||(a=i[y])}a!==null&&(a.selected=!0)}}function Vm(i,a,u){if(a!=null&&(a=""+Jt(a),a!==i.value&&(i.value=a),u==null)){i.defaultValue!==a&&(i.defaultValue=a);return}i.defaultValue=u!=null?""+Jt(u):""}function qm(i,a,u,h){if(a==null){if(h!=null){if(u!=null)throw Error(r(92));if($(h)){if(1<h.length)throw Error(r(93));h=h[0]}u=h}u==null&&(u=""),a=u}u=Jt(a),i.defaultValue=u,h=i.textContent,h===u&&h!==""&&h!==null&&(i.value=h)}function ga(i,a){if(a){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=a;return}}i.textContent=a}var b2=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Gm(i,a,u){var h=a.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?i.setProperty(a,""):a==="float"?i.cssFloat="":i[a]="":h?i.setProperty(a,u):typeof u!="number"||u===0||b2.has(a)?a==="float"?i.cssFloat=u:i[a]=(""+u).trim():i[a]=u+"px"}function Zm(i,a,u){if(a!=null&&typeof a!="object")throw Error(r(62));if(i=i.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||a!=null&&a.hasOwnProperty(h)||(h.indexOf("--")===0?i.setProperty(h,""):h==="float"?i.cssFloat="":i[h]="");for(var y in a)h=a[y],a.hasOwnProperty(y)&&u[y]!==h&&Gm(i,y,h)}else for(var v in a)a.hasOwnProperty(v)&&Gm(i,v,a[v])}function yf(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var v2=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),x2=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Oo(i){return x2.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}var bf=null;function vf(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var ma=null,ya=null;function Ym(i){var a=pr(i);if(a&&(i=a.stateNode)){var u=i[Ut]||null;e:switch(i=a.stateNode,a.type){case"input":if(ha(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),a=u.name,u.type==="radio"&&a!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Wt(""+a)+'"][type="radio"]'),a=0;a<u.length;a++){var h=u[a];if(h!==i&&h.form===i.form){var y=h[Ut]||null;if(!y)throw Error(r(90));ha(h,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(a=0;a<u.length;a++)h=u[a],h.form===i.form&&No(h)}break e;case"textarea":Vm(i,u.value,u.defaultValue);break e;case"select":a=u.value,a!=null&&pa(i,!!u.multiple,a,!1)}}}var xf=!1;function Xm(i,a,u){if(xf)return i(a,u);xf=!0;try{var h=i(a);return h}finally{if(xf=!1,(ma!==null||ya!==null)&&(gu(),ma&&(a=ma,i=ya,ya=ma=null,Ym(a),i)))for(a=0;a<i.length;a++)Ym(i[a])}}function Rs(i,a){var u=i.stateNode;if(u===null)return null;var h=u[Ut]||null;if(h===null)return null;u=h[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(i=i.type,h=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!h;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(r(231,a,typeof u));return u}var mr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wf=!1;if(mr)try{var Ds={};Object.defineProperty(Ds,"passive",{get:function(){wf=!0}}),window.addEventListener("test",Ds,Ds),window.removeEventListener("test",Ds,Ds)}catch{wf=!1}var Vr=null,_f=null,Mo=null;function Qm(){if(Mo)return Mo;var i,a=_f,u=a.length,h,y="value"in Vr?Vr.value:Vr.textContent,v=y.length;for(i=0;i<u&&a[i]===y[i];i++);var N=u-i;for(h=1;h<=N&&a[u-h]===y[v-h];h++);return Mo=y.slice(i,1<h?1-h:void 0)}function Ro(i){var a=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&a===13&&(i=13)):i=a,i===10&&(i=13),32<=i||i===13?i:0}function Do(){return!0}function Km(){return!1}function en(i){function a(u,h,y,v,N){this._reactName=u,this._targetInst=y,this.type=h,this.nativeEvent=v,this.target=N,this.currentTarget=null;for(var z in i)i.hasOwnProperty(z)&&(u=i[z],this[z]=u?u(v):v[z]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Do:Km,this.isPropagationStopped=Km,this}return p(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Do)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Do)},persist:function(){},isPersistent:Do}),a}var Oi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jo=en(Oi),js=p({},Oi,{view:0,detail:0}),w2=en(js),Sf,kf,zs,zo=p({},js,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Af,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==zs&&(zs&&i.type==="mousemove"?(Sf=i.screenX-zs.screenX,kf=i.screenY-zs.screenY):kf=Sf=0,zs=i),Sf)},movementY:function(i){return"movementY"in i?i.movementY:kf}}),Jm=en(zo),_2=p({},zo,{dataTransfer:0}),S2=en(_2),k2=p({},js,{relatedTarget:0}),Ef=en(k2),E2=p({},Oi,{animationName:0,elapsedTime:0,pseudoElement:0}),A2=en(E2),T2=p({},Oi,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),C2=en(T2),N2=p({},Oi,{data:0}),Wm=en(N2),O2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},M2={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},R2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function D2(i){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(i):(i=R2[i])?!!a[i]:!1}function Af(){return D2}var j2=p({},js,{key:function(i){if(i.key){var a=O2[i.key]||i.key;if(a!=="Unidentified")return a}return i.type==="keypress"?(i=Ro(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?M2[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Af,charCode:function(i){return i.type==="keypress"?Ro(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Ro(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),z2=en(j2),L2=p({},zo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ey=en(L2),I2=p({},js,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Af}),B2=en(I2),F2=p({},Oi,{propertyName:0,elapsedTime:0,pseudoElement:0}),P2=en(F2),U2=p({},zo,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),H2=en(U2),$2=p({},Oi,{newState:0,oldState:0}),V2=en($2),q2=[9,13,27,32],Tf=mr&&"CompositionEvent"in window,Ls=null;mr&&"documentMode"in document&&(Ls=document.documentMode);var G2=mr&&"TextEvent"in window&&!Ls,ty=mr&&(!Tf||Ls&&8<Ls&&11>=Ls),ny=" ",ry=!1;function iy(i,a){switch(i){case"keyup":return q2.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ay(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var ba=!1;function Z2(i,a){switch(i){case"compositionend":return ay(a);case"keypress":return a.which!==32?null:(ry=!0,ny);case"textInput":return i=a.data,i===ny&&ry?null:i;default:return null}}function Y2(i,a){if(ba)return i==="compositionend"||!Tf&&iy(i,a)?(i=Qm(),Mo=_f=Vr=null,ba=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return ty&&a.locale!=="ko"?null:a.data;default:return null}}var X2={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function sy(i){var a=i&&i.nodeName&&i.nodeName.toLowerCase();return a==="input"?!!X2[i.type]:a==="textarea"}function ly(i,a,u,h){ma?ya?ya.push(h):ya=[h]:ma=h,a=wu(a,"onChange"),0<a.length&&(u=new jo("onChange","change",null,u,h),i.push({event:u,listeners:a}))}var Is=null,Bs=null;function Q2(i){Ub(i,0)}function Lo(i){var a=Fr(i);if(No(a))return i}function oy(i,a){if(i==="change")return a}var uy=!1;if(mr){var Cf;if(mr){var Nf="oninput"in document;if(!Nf){var cy=document.createElement("div");cy.setAttribute("oninput","return;"),Nf=typeof cy.oninput=="function"}Cf=Nf}else Cf=!1;uy=Cf&&(!document.documentMode||9<document.documentMode)}function fy(){Is&&(Is.detachEvent("onpropertychange",dy),Bs=Is=null)}function dy(i){if(i.propertyName==="value"&&Lo(Bs)){var a=[];ly(a,Bs,i,vf(i)),Xm(Q2,a)}}function K2(i,a,u){i==="focusin"?(fy(),Is=a,Bs=u,Is.attachEvent("onpropertychange",dy)):i==="focusout"&&fy()}function J2(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Lo(Bs)}function W2(i,a){if(i==="click")return Lo(a)}function eA(i,a){if(i==="input"||i==="change")return Lo(a)}function tA(i,a){return i===a&&(i!==0||1/i===1/a)||i!==i&&a!==a}var cn=typeof Object.is=="function"?Object.is:tA;function Fs(i,a){if(cn(i,a))return!0;if(typeof i!="object"||i===null||typeof a!="object"||a===null)return!1;var u=Object.keys(i),h=Object.keys(a);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var y=u[h];if(!be.call(a,y)||!cn(i[y],a[y]))return!1}return!0}function hy(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function py(i,a){var u=hy(i);i=0;for(var h;u;){if(u.nodeType===3){if(h=i+u.textContent.length,i<=a&&h>=a)return{node:u,offset:a-i};i=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=hy(u)}}function gy(i,a){return i&&a?i===a?!0:i&&i.nodeType===3?!1:a&&a.nodeType===3?gy(i,a.parentNode):"contains"in i?i.contains(a):i.compareDocumentPosition?!!(i.compareDocumentPosition(a)&16):!1:!1}function my(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var a=$r(i.document);a instanceof i.HTMLIFrameElement;){try{var u=typeof a.contentWindow.location.href=="string"}catch{u=!1}if(u)i=a.contentWindow;else break;a=$r(i.document)}return a}function Of(i){var a=i&&i.nodeName&&i.nodeName.toLowerCase();return a&&(a==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||a==="textarea"||i.contentEditable==="true")}var nA=mr&&"documentMode"in document&&11>=document.documentMode,va=null,Mf=null,Ps=null,Rf=!1;function yy(i,a,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Rf||va==null||va!==$r(h)||(h=va,"selectionStart"in h&&Of(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Ps&&Fs(Ps,h)||(Ps=h,h=wu(Mf,"onSelect"),0<h.length&&(a=new jo("onSelect","select",null,a,u),i.push({event:a,listeners:h}),a.target=va)))}function Mi(i,a){var u={};return u[i.toLowerCase()]=a.toLowerCase(),u["Webkit"+i]="webkit"+a,u["Moz"+i]="moz"+a,u}var xa={animationend:Mi("Animation","AnimationEnd"),animationiteration:Mi("Animation","AnimationIteration"),animationstart:Mi("Animation","AnimationStart"),transitionrun:Mi("Transition","TransitionRun"),transitionstart:Mi("Transition","TransitionStart"),transitioncancel:Mi("Transition","TransitionCancel"),transitionend:Mi("Transition","TransitionEnd")},Df={},by={};mr&&(by=document.createElement("div").style,"AnimationEvent"in window||(delete xa.animationend.animation,delete xa.animationiteration.animation,delete xa.animationstart.animation),"TransitionEvent"in window||delete xa.transitionend.transition);function Ri(i){if(Df[i])return Df[i];if(!xa[i])return i;var a=xa[i],u;for(u in a)if(a.hasOwnProperty(u)&&u in by)return Df[i]=a[u];return i}var vy=Ri("animationend"),xy=Ri("animationiteration"),wy=Ri("animationstart"),rA=Ri("transitionrun"),iA=Ri("transitionstart"),aA=Ri("transitioncancel"),_y=Ri("transitionend"),Sy=new Map,jf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");jf.push("scrollEnd");function Ln(i,a){Sy.set(i,a),gr(a,[i])}var ky=new WeakMap;function kn(i,a){if(typeof i=="object"&&i!==null){var u=ky.get(i);return u!==void 0?u:(a={value:i,source:a,stack:To(a)},ky.set(i,a),a)}return{value:i,source:a,stack:To(a)}}var En=[],wa=0,zf=0;function Io(){for(var i=wa,a=zf=wa=0;a<i;){var u=En[a];En[a++]=null;var h=En[a];En[a++]=null;var y=En[a];En[a++]=null;var v=En[a];if(En[a++]=null,h!==null&&y!==null){var N=h.pending;N===null?y.next=y:(y.next=N.next,N.next=y),h.pending=y}v!==0&&Ey(u,y,v)}}function Bo(i,a,u,h){En[wa++]=i,En[wa++]=a,En[wa++]=u,En[wa++]=h,zf|=h,i.lanes|=h,i=i.alternate,i!==null&&(i.lanes|=h)}function Lf(i,a,u,h){return Bo(i,a,u,h),Fo(i)}function _a(i,a){return Bo(i,null,null,a),Fo(i)}function Ey(i,a,u){i.lanes|=u;var h=i.alternate;h!==null&&(h.lanes|=u);for(var y=!1,v=i.return;v!==null;)v.childLanes|=u,h=v.alternate,h!==null&&(h.childLanes|=u),v.tag===22&&(i=v.stateNode,i===null||i._visibility&1||(y=!0)),i=v,v=v.return;return i.tag===3?(v=i.stateNode,y&&a!==null&&(y=31-Te(u),i=v.hiddenUpdates,h=i[y],h===null?i[y]=[a]:h.push(a),a.lane=u|536870912),v):null}function Fo(i){if(50<fl)throw fl=0,Hd=null,Error(r(185));for(var a=i.return;a!==null;)i=a,a=i.return;return i.tag===3?i.stateNode:null}var Sa={};function sA(i,a,u,h){this.tag=i,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fn(i,a,u,h){return new sA(i,a,u,h)}function If(i){return i=i.prototype,!(!i||!i.isReactComponent)}function yr(i,a){var u=i.alternate;return u===null?(u=fn(i.tag,a,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=a,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,a=i.dependencies,u.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function Ay(i,a){i.flags&=65011714;var u=i.alternate;return u===null?(i.childLanes=0,i.lanes=a,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,a=u.dependencies,i.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),i}function Po(i,a,u,h,y,v){var N=0;if(h=i,typeof i=="function")If(i)&&(N=1);else if(typeof i=="string")N=oT(i,u,V.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case U:return i=fn(31,u,a,y),i.elementType=U,i.lanes=v,i;case x:return Di(u.children,y,v,a);case w:N=8,y|=24;break;case _:return i=fn(12,u,a,y|2),i.elementType=_,i.lanes=v,i;case D:return i=fn(13,u,a,y),i.elementType=D,i.lanes=v,i;case M:return i=fn(19,u,a,y),i.elementType=M,i.lanes=v,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case k:case S:N=10;break e;case A:N=9;break e;case O:N=11;break e;case F:N=14;break e;case L:N=16,h=null;break e}N=29,u=Error(r(130,i===null?"null":typeof i,"")),h=null}return a=fn(N,u,a,y),a.elementType=i,a.type=h,a.lanes=v,a}function Di(i,a,u,h){return i=fn(7,i,h,a),i.lanes=u,i}function Bf(i,a,u){return i=fn(6,i,null,a),i.lanes=u,i}function Ff(i,a,u){return a=fn(4,i.children!==null?i.children:[],i.key,a),a.lanes=u,a.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},a}var ka=[],Ea=0,Uo=null,Ho=0,An=[],Tn=0,ji=null,br=1,vr="";function zi(i,a){ka[Ea++]=Ho,ka[Ea++]=Uo,Uo=i,Ho=a}function Ty(i,a,u){An[Tn++]=br,An[Tn++]=vr,An[Tn++]=ji,ji=i;var h=br;i=vr;var y=32-Te(h)-1;h&=~(1<<y),u+=1;var v=32-Te(a)+y;if(30<v){var N=y-y%5;v=(h&(1<<N)-1).toString(32),h>>=N,y-=N,br=1<<32-Te(a)+y|u<<y|h,vr=v+i}else br=1<<v|u<<y|h,vr=i}function Pf(i){i.return!==null&&(zi(i,1),Ty(i,1,0))}function Uf(i){for(;i===Uo;)Uo=ka[--Ea],ka[Ea]=null,Ho=ka[--Ea],ka[Ea]=null;for(;i===ji;)ji=An[--Tn],An[Tn]=null,vr=An[--Tn],An[Tn]=null,br=An[--Tn],An[Tn]=null}var Yt=null,gt=null,Ke=!1,Li=null,Wn=!1,Hf=Error(r(519));function Ii(i){var a=Error(r(418,""));throw $s(kn(a,i)),Hf}function Cy(i){var a=i.stateNode,u=i.type,h=i.memoizedProps;switch(a[Mt]=i,a[Ut]=h,u){case"dialog":He("cancel",a),He("close",a);break;case"iframe":case"object":case"embed":He("load",a);break;case"video":case"audio":for(u=0;u<hl.length;u++)He(hl[u],a);break;case"source":He("error",a);break;case"img":case"image":case"link":He("error",a),He("load",a);break;case"details":He("toggle",a);break;case"input":He("invalid",a),$m(a,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0),da(a);break;case"select":He("invalid",a);break;case"textarea":He("invalid",a),qm(a,h.value,h.defaultValue,h.children),da(a)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||a.textContent===""+u||h.suppressHydrationWarning===!0||qb(a.textContent,u)?(h.popover!=null&&(He("beforetoggle",a),He("toggle",a)),h.onScroll!=null&&He("scroll",a),h.onScrollEnd!=null&&He("scrollend",a),h.onClick!=null&&(a.onclick=_u),a=!0):a=!1,a||Ii(i)}function Ny(i){for(Yt=i.return;Yt;)switch(Yt.tag){case 5:case 13:Wn=!1;return;case 27:case 3:Wn=!0;return;default:Yt=Yt.return}}function Us(i){if(i!==Yt)return!1;if(!Ke)return Ny(i),Ke=!0,!1;var a=i.tag,u;if((u=a!==3&&a!==27)&&((u=a===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||ih(i.type,i.memoizedProps)),u=!u),u&>&&Ii(i),Ny(i),a===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));e:{for(i=i.nextSibling,a=0;i;){if(i.nodeType===8)if(u=i.data,u==="/$"){if(a===0){gt=Bn(i.nextSibling);break e}a--}else u!=="$"&&u!=="$!"&&u!=="$?"||a++;i=i.nextSibling}gt=null}}else a===27?(a=gt,si(i.type)?(i=oh,oh=null,gt=i):gt=a):gt=Yt?Bn(i.stateNode.nextSibling):null;return!0}function Hs(){gt=Yt=null,Ke=!1}function Oy(){var i=Li;return i!==null&&(rn===null?rn=i:rn.push.apply(rn,i),Li=null),i}function $s(i){Li===null?Li=[i]:Li.push(i)}var $f=G(null),Bi=null,xr=null;function qr(i,a,u){T($f,a._currentValue),a._currentValue=u}function wr(i){i._currentValue=$f.current,te($f)}function Vf(i,a,u){for(;i!==null;){var h=i.alternate;if((i.childLanes&a)!==a?(i.childLanes|=a,h!==null&&(h.childLanes|=a)):h!==null&&(h.childLanes&a)!==a&&(h.childLanes|=a),i===u)break;i=i.return}}function qf(i,a,u,h){var y=i.child;for(y!==null&&(y.return=i);y!==null;){var v=y.dependencies;if(v!==null){var N=y.child;v=v.firstContext;e:for(;v!==null;){var z=v;v=y;for(var Z=0;Z<a.length;Z++)if(z.context===a[Z]){v.lanes|=u,z=v.alternate,z!==null&&(z.lanes|=u),Vf(v.return,u,i),h||(N=null);break e}v=z.next}}else if(y.tag===18){if(N=y.return,N===null)throw Error(r(341));N.lanes|=u,v=N.alternate,v!==null&&(v.lanes|=u),Vf(N,u,i),N=null}else N=y.child;if(N!==null)N.return=y;else for(N=y;N!==null;){if(N===i){N=null;break}if(y=N.sibling,y!==null){y.return=N.return,N=y;break}N=N.return}y=N}}function Vs(i,a,u,h){i=null;for(var y=a,v=!1;y!==null;){if(!v){if((y.flags&524288)!==0)v=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var N=y.alternate;if(N===null)throw Error(r(387));if(N=N.memoizedProps,N!==null){var z=y.type;cn(y.pendingProps.value,N.value)||(i!==null?i.push(z):i=[z])}}else if(y===le.current){if(N=y.alternate,N===null)throw Error(r(387));N.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(i!==null?i.push(vl):i=[vl])}y=y.return}i!==null&&qf(a,i,u,h),a.flags|=262144}function $o(i){for(i=i.firstContext;i!==null;){if(!cn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Fi(i){Bi=i,xr=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Ht(i){return My(Bi,i)}function Vo(i,a){return Bi===null&&Fi(i),My(i,a)}function My(i,a){var u=a._currentValue;if(a={context:a,memoizedValue:u,next:null},xr===null){if(i===null)throw Error(r(308));xr=a,i.dependencies={lanes:0,firstContext:a},i.flags|=524288}else xr=xr.next=a;return u}var lA=typeof AbortController<"u"?AbortController:function(){var i=[],a=this.signal={aborted:!1,addEventListener:function(u,h){i.push(h)}};this.abort=function(){a.aborted=!0,i.forEach(function(u){return u()})}},oA=e.unstable_scheduleCallback,uA=e.unstable_NormalPriority,Nt={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Gf(){return{controller:new lA,data:new Map,refCount:0}}function qs(i){i.refCount--,i.refCount===0&&oA(uA,function(){i.controller.abort()})}var Gs=null,Zf=0,Aa=0,Ta=null;function cA(i,a){if(Gs===null){var u=Gs=[];Zf=0,Aa=Xd(),Ta={status:"pending",value:void 0,then:function(h){u.push(h)}}}return Zf++,a.then(Ry,Ry),a}function Ry(){if(--Zf===0&&Gs!==null){Ta!==null&&(Ta.status="fulfilled");var i=Gs;Gs=null,Aa=0,Ta=null;for(var a=0;a<i.length;a++)(0,i[a])()}}function fA(i,a){var u=[],h={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return i.then(function(){h.status="fulfilled",h.value=a;for(var y=0;y<u.length;y++)(0,u[y])(a)},function(y){for(h.status="rejected",h.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),h}var Dy=I.S;I.S=function(i,a){typeof a=="object"&&a!==null&&typeof a.then=="function"&&cA(i,a),Dy!==null&&Dy(i,a)};var Pi=G(null);function Yf(){var i=Pi.current;return i!==null?i:ot.pooledCache}function qo(i,a){a===null?T(Pi,Pi.current):T(Pi,a.pool)}function jy(){var i=Yf();return i===null?null:{parent:Nt._currentValue,pool:i}}var Zs=Error(r(460)),zy=Error(r(474)),Go=Error(r(542)),Xf={then:function(){}};function Ly(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Zo(){}function Iy(i,a,u){switch(u=i[u],u===void 0?i.push(a):u!==a&&(a.then(Zo,Zo),a=u),a.status){case"fulfilled":return a.value;case"rejected":throw i=a.reason,Fy(i),i;default:if(typeof a.status=="string")a.then(Zo,Zo);else{if(i=ot,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=a,i.status="pending",i.then(function(h){if(a.status==="pending"){var y=a;y.status="fulfilled",y.value=h}},function(h){if(a.status==="pending"){var y=a;y.status="rejected",y.reason=h}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw i=a.reason,Fy(i),i}throw Ys=a,Zs}}var Ys=null;function By(){if(Ys===null)throw Error(r(459));var i=Ys;return Ys=null,i}function Fy(i){if(i===Zs||i===Go)throw Error(r(483))}var Gr=!1;function Qf(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kf(i,a){i=i.updateQueue,a.updateQueue===i&&(a.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Zr(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Yr(i,a,u){var h=i.updateQueue;if(h===null)return null;if(h=h.shared,(We&2)!==0){var y=h.pending;return y===null?a.next=a:(a.next=y.next,y.next=a),h.pending=a,a=Fo(i),Ey(i,null,u),a}return Bo(i,h,a,u),Fo(i)}function Xs(i,a,u){if(a=a.updateQueue,a!==null&&(a=a.shared,(u&4194048)!==0)){var h=a.lanes;h&=i.pendingLanes,u|=h,a.lanes=u,vo(i,u)}}function Jf(i,a){var u=i.updateQueue,h=i.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var y=null,v=null;if(u=u.firstBaseUpdate,u!==null){do{var N={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};v===null?y=v=N:v=v.next=N,u=u.next}while(u!==null);v===null?y=v=a:v=v.next=a}else y=v=a;u={baseState:h.baseState,firstBaseUpdate:y,lastBaseUpdate:v,shared:h.shared,callbacks:h.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=a:i.next=a,u.lastBaseUpdate=a}var Wf=!1;function Qs(){if(Wf){var i=Ta;if(i!==null)throw i}}function Ks(i,a,u,h){Wf=!1;var y=i.updateQueue;Gr=!1;var v=y.firstBaseUpdate,N=y.lastBaseUpdate,z=y.shared.pending;if(z!==null){y.shared.pending=null;var Z=z,re=Z.next;Z.next=null,N===null?v=re:N.next=re,N=Z;var oe=i.alternate;oe!==null&&(oe=oe.updateQueue,z=oe.lastBaseUpdate,z!==N&&(z===null?oe.firstBaseUpdate=re:z.next=re,oe.lastBaseUpdate=Z))}if(v!==null){var de=y.baseState;N=0,oe=re=Z=null,z=v;do{var ie=z.lane&-536870913,ae=ie!==z.lane;if(ae?(Ve&ie)===ie:(h&ie)===ie){ie!==0&&ie===Aa&&(Wf=!0),oe!==null&&(oe=oe.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var Re=i,Oe=z;ie=a;var it=u;switch(Oe.tag){case 1:if(Re=Oe.payload,typeof Re=="function"){de=Re.call(it,de,ie);break e}de=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=Oe.payload,ie=typeof Re=="function"?Re.call(it,de,ie):Re,ie==null)break e;de=p({},de,ie);break e;case 2:Gr=!0}}ie=z.callback,ie!==null&&(i.flags|=64,ae&&(i.flags|=8192),ae=y.callbacks,ae===null?y.callbacks=[ie]:ae.push(ie))}else ae={lane:ie,tag:z.tag,payload:z.payload,callback:z.callback,next:null},oe===null?(re=oe=ae,Z=de):oe=oe.next=ae,N|=ie;if(z=z.next,z===null){if(z=y.shared.pending,z===null)break;ae=z,z=ae.next,ae.next=null,y.lastBaseUpdate=ae,y.shared.pending=null}}while(!0);oe===null&&(Z=de),y.baseState=Z,y.firstBaseUpdate=re,y.lastBaseUpdate=oe,v===null&&(y.shared.lanes=0),ni|=N,i.lanes=N,i.memoizedState=de}}function Py(i,a){if(typeof i!="function")throw Error(r(191,i));i.call(a)}function Uy(i,a){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)Py(u[i],a)}var Ca=G(null),Yo=G(0);function Hy(i,a){i=Cr,T(Yo,i),T(Ca,a),Cr=i|a.baseLanes}function ed(){T(Yo,Cr),T(Ca,Ca.current)}function td(){Cr=Yo.current,te(Ca),te(Yo)}var Xr=0,Be=null,nt=null,St=null,Xo=!1,Na=!1,Ui=!1,Qo=0,Js=0,Oa=null,dA=0;function bt(){throw Error(r(321))}function nd(i,a){if(a===null)return!1;for(var u=0;u<a.length&&u<i.length;u++)if(!cn(i[u],a[u]))return!1;return!0}function rd(i,a,u,h,y,v){return Xr=v,Be=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,I.H=i===null||i.memoizedState===null?E0:A0,Ui=!1,v=u(h,y),Ui=!1,Na&&(v=Vy(a,u,h,y)),$y(i),v}function $y(i){I.H=nu;var a=nt!==null&&nt.next!==null;if(Xr=0,St=nt=Be=null,Xo=!1,Js=0,Oa=null,a)throw Error(r(300));i===null||Rt||(i=i.dependencies,i!==null&&$o(i)&&(Rt=!0))}function Vy(i,a,u,h){Be=i;var y=0;do{if(Na&&(Oa=null),Js=0,Na=!1,25<=y)throw Error(r(301));if(y+=1,St=nt=null,i.updateQueue!=null){var v=i.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}I.H=vA,v=a(u,h)}while(Na);return v}function hA(){var i=I.H,a=i.useState()[0];return a=typeof a.then=="function"?Ws(a):a,i=i.useState()[0],(nt!==null?nt.memoizedState:null)!==i&&(Be.flags|=1024),a}function id(){var i=Qo!==0;return Qo=0,i}function ad(i,a,u){a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~u}function sd(i){if(Xo){for(i=i.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Xo=!1}Xr=0,St=nt=Be=null,Na=!1,Js=Qo=0,Oa=null}function tn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return St===null?Be.memoizedState=St=i:St=St.next=i,St}function kt(){if(nt===null){var i=Be.alternate;i=i!==null?i.memoizedState:null}else i=nt.next;var a=St===null?Be.memoizedState:St.next;if(a!==null)St=a,nt=i;else{if(i===null)throw Be.alternate===null?Error(r(467)):Error(r(310));nt=i,i={memoizedState:nt.memoizedState,baseState:nt.baseState,baseQueue:nt.baseQueue,queue:nt.queue,next:null},St===null?Be.memoizedState=St=i:St=St.next=i}return St}function ld(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ws(i){var a=Js;return Js+=1,Oa===null&&(Oa=[]),i=Iy(Oa,i,a),a=Be,(St===null?a.memoizedState:St.next)===null&&(a=a.alternate,I.H=a===null||a.memoizedState===null?E0:A0),i}function Ko(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Ws(i);if(i.$$typeof===S)return Ht(i)}throw Error(r(438,String(i)))}function od(i){var a=null,u=Be.updateQueue;if(u!==null&&(a=u.memoCache),a==null){var h=Be.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(a={data:h.data.map(function(y){return y.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),u===null&&(u=ld(),Be.updateQueue=u),u.memoCache=a,u=a.data[a.index],u===void 0)for(u=a.data[a.index]=Array(i),h=0;h<i;h++)u[h]=j;return a.index++,u}function _r(i,a){return typeof a=="function"?a(i):a}function Jo(i){var a=kt();return ud(a,nt,i)}function ud(i,a,u){var h=i.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=u;var y=i.baseQueue,v=h.pending;if(v!==null){if(y!==null){var N=y.next;y.next=v.next,v.next=N}a.baseQueue=y=v,h.pending=null}if(v=i.baseState,y===null)i.memoizedState=v;else{a=y.next;var z=N=null,Z=null,re=a,oe=!1;do{var de=re.lane&-536870913;if(de!==re.lane?(Ve&de)===de:(Xr&de)===de){var ie=re.revertLane;if(ie===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),de===Aa&&(oe=!0);else if((Xr&ie)===ie){re=re.next,ie===Aa&&(oe=!0);continue}else de={lane:0,revertLane:re.revertLane,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},Z===null?(z=Z=de,N=v):Z=Z.next=de,Be.lanes|=ie,ni|=ie;de=re.action,Ui&&u(v,de),v=re.hasEagerState?re.eagerState:u(v,de)}else ie={lane:de,revertLane:re.revertLane,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},Z===null?(z=Z=ie,N=v):Z=Z.next=ie,Be.lanes|=de,ni|=de;re=re.next}while(re!==null&&re!==a);if(Z===null?N=v:Z.next=z,!cn(v,i.memoizedState)&&(Rt=!0,oe&&(u=Ta,u!==null)))throw u;i.memoizedState=v,i.baseState=N,i.baseQueue=Z,h.lastRenderedState=v}return y===null&&(h.lanes=0),[i.memoizedState,h.dispatch]}function cd(i){var a=kt(),u=a.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var h=u.dispatch,y=u.pending,v=a.memoizedState;if(y!==null){u.pending=null;var N=y=y.next;do v=i(v,N.action),N=N.next;while(N!==y);cn(v,a.memoizedState)||(Rt=!0),a.memoizedState=v,a.baseQueue===null&&(a.baseState=v),u.lastRenderedState=v}return[v,h]}function qy(i,a,u){var h=Be,y=kt(),v=Ke;if(v){if(u===void 0)throw Error(r(407));u=u()}else u=a();var N=!cn((nt||y).memoizedState,u);N&&(y.memoizedState=u,Rt=!0),y=y.queue;var z=Yy.bind(null,h,y,i);if(el(2048,8,z,[i]),y.getSnapshot!==a||N||St!==null&&St.memoizedState.tag&1){if(h.flags|=2048,Ma(9,Wo(),Zy.bind(null,h,y,u,a),null),ot===null)throw Error(r(349));v||(Xr&124)!==0||Gy(h,a,u)}return u}function Gy(i,a,u){i.flags|=16384,i={getSnapshot:a,value:u},a=Be.updateQueue,a===null?(a=ld(),Be.updateQueue=a,a.stores=[i]):(u=a.stores,u===null?a.stores=[i]:u.push(i))}function Zy(i,a,u,h){a.value=u,a.getSnapshot=h,Xy(a)&&Qy(i)}function Yy(i,a,u){return u(function(){Xy(a)&&Qy(i)})}function Xy(i){var a=i.getSnapshot;i=i.value;try{var u=a();return!cn(i,u)}catch{return!0}}function Qy(i){var a=_a(i,2);a!==null&&mn(a,i,2)}function fd(i){var a=tn();if(typeof i=="function"){var u=i;if(i=u(),Ui){Ee(!0);try{u()}finally{Ee(!1)}}}return a.memoizedState=a.baseState=i,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_r,lastRenderedState:i},a}function Ky(i,a,u,h){return i.baseState=u,ud(i,nt,typeof h=="function"?h:_r)}function pA(i,a,u,h,y){if(tu(i))throw Error(r(485));if(i=a.action,i!==null){var v={payload:y,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){v.listeners.push(N)}};I.T!==null?u(!0):v.isTransition=!1,h(v),u=a.pending,u===null?(v.next=a.pending=v,Jy(a,v)):(v.next=u.next,a.pending=u.next=v)}}function Jy(i,a){var u=a.action,h=a.payload,y=i.state;if(a.isTransition){var v=I.T,N={};I.T=N;try{var z=u(y,h),Z=I.S;Z!==null&&Z(N,z),Wy(i,a,z)}catch(re){dd(i,a,re)}finally{I.T=v}}else try{v=u(y,h),Wy(i,a,v)}catch(re){dd(i,a,re)}}function Wy(i,a,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){e0(i,a,h)},function(h){return dd(i,a,h)}):e0(i,a,u)}function e0(i,a,u){a.status="fulfilled",a.value=u,t0(a),i.state=u,a=i.pending,a!==null&&(u=a.next,u===a?i.pending=null:(u=u.next,a.next=u,Jy(i,u)))}function dd(i,a,u){var h=i.pending;if(i.pending=null,h!==null){h=h.next;do a.status="rejected",a.reason=u,t0(a),a=a.next;while(a!==h)}i.action=null}function t0(i){i=i.listeners;for(var a=0;a<i.length;a++)(0,i[a])()}function n0(i,a){return a}function r0(i,a){if(Ke){var u=ot.formState;if(u!==null){e:{var h=Be;if(Ke){if(gt){t:{for(var y=gt,v=Wn;y.nodeType!==8;){if(!v){y=null;break t}if(y=Bn(y.nextSibling),y===null){y=null;break t}}v=y.data,y=v==="F!"||v==="F"?y:null}if(y){gt=Bn(y.nextSibling),h=y.data==="F!";break e}}Ii(h)}h=!1}h&&(a=u[0])}}return u=tn(),u.memoizedState=u.baseState=a,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n0,lastRenderedState:a},u.queue=h,u=_0.bind(null,Be,h),h.dispatch=u,h=fd(!1),v=yd.bind(null,Be,!1,h.queue),h=tn(),y={state:a,dispatch:null,action:i,pending:null},h.queue=y,u=pA.bind(null,Be,y,v,u),y.dispatch=u,h.memoizedState=i,[a,u,!1]}function i0(i){var a=kt();return a0(a,nt,i)}function a0(i,a,u){if(a=ud(i,a,n0)[0],i=Jo(_r)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var h=Ws(a)}catch(N){throw N===Zs?Go:N}else h=a;a=kt();var y=a.queue,v=y.dispatch;return u!==a.memoizedState&&(Be.flags|=2048,Ma(9,Wo(),gA.bind(null,y,u),null)),[h,v,i]}function gA(i,a){i.action=a}function s0(i){var a=kt(),u=nt;if(u!==null)return a0(a,u,i);kt(),a=a.memoizedState,u=kt();var h=u.queue.dispatch;return u.memoizedState=i,[a,h,!1]}function Ma(i,a,u,h){return i={tag:i,create:u,deps:h,inst:a,next:null},a=Be.updateQueue,a===null&&(a=ld(),Be.updateQueue=a),u=a.lastEffect,u===null?a.lastEffect=i.next=i:(h=u.next,u.next=i,i.next=h,a.lastEffect=i),i}function Wo(){return{destroy:void 0,resource:void 0}}function l0(){return kt().memoizedState}function eu(i,a,u,h){var y=tn();h=h===void 0?null:h,Be.flags|=i,y.memoizedState=Ma(1|a,Wo(),u,h)}function el(i,a,u,h){var y=kt();h=h===void 0?null:h;var v=y.memoizedState.inst;nt!==null&&h!==null&&nd(h,nt.memoizedState.deps)?y.memoizedState=Ma(a,v,u,h):(Be.flags|=i,y.memoizedState=Ma(1|a,v,u,h))}function o0(i,a){eu(8390656,8,i,a)}function u0(i,a){el(2048,8,i,a)}function c0(i,a){return el(4,2,i,a)}function f0(i,a){return el(4,4,i,a)}function d0(i,a){if(typeof a=="function"){i=i();var u=a(i);return function(){typeof u=="function"?u():a(null)}}if(a!=null)return i=i(),a.current=i,function(){a.current=null}}function h0(i,a,u){u=u!=null?u.concat([i]):null,el(4,4,d0.bind(null,a,i),u)}function hd(){}function p0(i,a){var u=kt();a=a===void 0?null:a;var h=u.memoizedState;return a!==null&&nd(a,h[1])?h[0]:(u.memoizedState=[i,a],i)}function g0(i,a){var u=kt();a=a===void 0?null:a;var h=u.memoizedState;if(a!==null&&nd(a,h[1]))return h[0];if(h=i(),Ui){Ee(!0);try{i()}finally{Ee(!1)}}return u.memoizedState=[h,a],h}function pd(i,a,u){return u===void 0||(Xr&1073741824)!==0?i.memoizedState=a:(i.memoizedState=u,i=bb(),Be.lanes|=i,ni|=i,u)}function m0(i,a,u,h){return cn(u,a)?u:Ca.current!==null?(i=pd(i,u,h),cn(i,a)||(Rt=!0),i):(Xr&42)===0?(Rt=!0,i.memoizedState=u):(i=bb(),Be.lanes|=i,ni|=i,a)}function y0(i,a,u,h,y){var v=P.p;P.p=v!==0&&8>v?v:8;var N=I.T,z={};I.T=z,yd(i,!1,a,u);try{var Z=y(),re=I.S;if(re!==null&&re(z,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var oe=fA(Z,h);tl(i,a,oe,gn(i))}else tl(i,a,h,gn(i))}catch(de){tl(i,a,{then:function(){},status:"rejected",reason:de},gn())}finally{P.p=v,I.T=N}}function mA(){}function gd(i,a,u,h){if(i.tag!==5)throw Error(r(476));var y=b0(i).queue;y0(i,y,a,Y,u===null?mA:function(){return v0(i),u(h)})}function b0(i){var a=i.memoizedState;if(a!==null)return a;a={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_r,lastRenderedState:Y},next:null};var u={};return a.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_r,lastRenderedState:u},next:null},i.memoizedState=a,i=i.alternate,i!==null&&(i.memoizedState=a),a}function v0(i){var a=b0(i).next.queue;tl(i,a,{},gn())}function md(){return Ht(vl)}function x0(){return kt().memoizedState}function w0(){return kt().memoizedState}function yA(i){for(var a=i.return;a!==null;){switch(a.tag){case 24:case 3:var u=gn();i=Zr(u);var h=Yr(a,i,u);h!==null&&(mn(h,a,u),Xs(h,a,u)),a={cache:Gf()},i.payload=a;return}a=a.return}}function bA(i,a,u){var h=gn();u={lane:h,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null},tu(i)?S0(a,u):(u=Lf(i,a,u,h),u!==null&&(mn(u,i,h),k0(u,a,h)))}function _0(i,a,u){var h=gn();tl(i,a,u,h)}function tl(i,a,u,h){var y={lane:h,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null};if(tu(i))S0(a,y);else{var v=i.alternate;if(i.lanes===0&&(v===null||v.lanes===0)&&(v=a.lastRenderedReducer,v!==null))try{var N=a.lastRenderedState,z=v(N,u);if(y.hasEagerState=!0,y.eagerState=z,cn(z,N))return Bo(i,a,y,0),ot===null&&Io(),!1}catch{}finally{}if(u=Lf(i,a,y,h),u!==null)return mn(u,i,h),k0(u,a,h),!0}return!1}function yd(i,a,u,h){if(h={lane:2,revertLane:Xd(),action:h,hasEagerState:!1,eagerState:null,next:null},tu(i)){if(a)throw Error(r(479))}else a=Lf(i,u,h,2),a!==null&&mn(a,i,2)}function tu(i){var a=i.alternate;return i===Be||a!==null&&a===Be}function S0(i,a){Na=Xo=!0;var u=i.pending;u===null?a.next=a:(a.next=u.next,u.next=a),i.pending=a}function k0(i,a,u){if((u&4194048)!==0){var h=a.lanes;h&=i.pendingLanes,u|=h,a.lanes=u,vo(i,u)}}var nu={readContext:Ht,use:Ko,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useLayoutEffect:bt,useInsertionEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useSyncExternalStore:bt,useId:bt,useHostTransitionStatus:bt,useFormState:bt,useActionState:bt,useOptimistic:bt,useMemoCache:bt,useCacheRefresh:bt},E0={readContext:Ht,use:Ko,useCallback:function(i,a){return tn().memoizedState=[i,a===void 0?null:a],i},useContext:Ht,useEffect:o0,useImperativeHandle:function(i,a,u){u=u!=null?u.concat([i]):null,eu(4194308,4,d0.bind(null,a,i),u)},useLayoutEffect:function(i,a){return eu(4194308,4,i,a)},useInsertionEffect:function(i,a){eu(4,2,i,a)},useMemo:function(i,a){var u=tn();a=a===void 0?null:a;var h=i();if(Ui){Ee(!0);try{i()}finally{Ee(!1)}}return u.memoizedState=[h,a],h},useReducer:function(i,a,u){var h=tn();if(u!==void 0){var y=u(a);if(Ui){Ee(!0);try{u(a)}finally{Ee(!1)}}}else y=a;return h.memoizedState=h.baseState=y,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:y},h.queue=i,i=i.dispatch=bA.bind(null,Be,i),[h.memoizedState,i]},useRef:function(i){var a=tn();return i={current:i},a.memoizedState=i},useState:function(i){i=fd(i);var a=i.queue,u=_0.bind(null,Be,a);return a.dispatch=u,[i.memoizedState,u]},useDebugValue:hd,useDeferredValue:function(i,a){var u=tn();return pd(u,i,a)},useTransition:function(){var i=fd(!1);return i=y0.bind(null,Be,i.queue,!0,!1),tn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,a,u){var h=Be,y=tn();if(Ke){if(u===void 0)throw Error(r(407));u=u()}else{if(u=a(),ot===null)throw Error(r(349));(Ve&124)!==0||Gy(h,a,u)}y.memoizedState=u;var v={value:u,getSnapshot:a};return y.queue=v,o0(Yy.bind(null,h,v,i),[i]),h.flags|=2048,Ma(9,Wo(),Zy.bind(null,h,v,u,a),null),u},useId:function(){var i=tn(),a=ot.identifierPrefix;if(Ke){var u=vr,h=br;u=(h&~(1<<32-Te(h)-1)).toString(32)+u,a="«"+a+"R"+u,u=Qo++,0<u&&(a+="H"+u.toString(32)),a+="»"}else u=dA++,a="«"+a+"r"+u.toString(32)+"»";return i.memoizedState=a},useHostTransitionStatus:md,useFormState:r0,useActionState:r0,useOptimistic:function(i){var a=tn();a.memoizedState=a.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=u,a=yd.bind(null,Be,!0,u),u.dispatch=a,[i,a]},useMemoCache:od,useCacheRefresh:function(){return tn().memoizedState=yA.bind(null,Be)}},A0={readContext:Ht,use:Ko,useCallback:p0,useContext:Ht,useEffect:u0,useImperativeHandle:h0,useInsertionEffect:c0,useLayoutEffect:f0,useMemo:g0,useReducer:Jo,useRef:l0,useState:function(){return Jo(_r)},useDebugValue:hd,useDeferredValue:function(i,a){var u=kt();return m0(u,nt.memoizedState,i,a)},useTransition:function(){var i=Jo(_r)[0],a=kt().memoizedState;return[typeof i=="boolean"?i:Ws(i),a]},useSyncExternalStore:qy,useId:x0,useHostTransitionStatus:md,useFormState:i0,useActionState:i0,useOptimistic:function(i,a){var u=kt();return Ky(u,nt,i,a)},useMemoCache:od,useCacheRefresh:w0},vA={readContext:Ht,use:Ko,useCallback:p0,useContext:Ht,useEffect:u0,useImperativeHandle:h0,useInsertionEffect:c0,useLayoutEffect:f0,useMemo:g0,useReducer:cd,useRef:l0,useState:function(){return cd(_r)},useDebugValue:hd,useDeferredValue:function(i,a){var u=kt();return nt===null?pd(u,i,a):m0(u,nt.memoizedState,i,a)},useTransition:function(){var i=cd(_r)[0],a=kt().memoizedState;return[typeof i=="boolean"?i:Ws(i),a]},useSyncExternalStore:qy,useId:x0,useHostTransitionStatus:md,useFormState:s0,useActionState:s0,useOptimistic:function(i,a){var u=kt();return nt!==null?Ky(u,nt,i,a):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:od,useCacheRefresh:w0},Ra=null,nl=0;function ru(i){var a=nl;return nl+=1,Ra===null&&(Ra=[]),Iy(Ra,i,a)}function rl(i,a){a=a.props.ref,i.ref=a!==void 0?a:null}function iu(i,a){throw a.$$typeof===g?Error(r(525)):(i=Object.prototype.toString.call(a),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":i)))}function T0(i){var a=i._init;return a(i._payload)}function C0(i){function a(ee,Q){if(i){var ne=ee.deletions;ne===null?(ee.deletions=[Q],ee.flags|=16):ne.push(Q)}}function u(ee,Q){if(!i)return null;for(;Q!==null;)a(ee,Q),Q=Q.sibling;return null}function h(ee){for(var Q=new Map;ee!==null;)ee.key!==null?Q.set(ee.key,ee):Q.set(ee.index,ee),ee=ee.sibling;return Q}function y(ee,Q){return ee=yr(ee,Q),ee.index=0,ee.sibling=null,ee}function v(ee,Q,ne){return ee.index=ne,i?(ne=ee.alternate,ne!==null?(ne=ne.index,ne<Q?(ee.flags|=67108866,Q):ne):(ee.flags|=67108866,Q)):(ee.flags|=1048576,Q)}function N(ee){return i&&ee.alternate===null&&(ee.flags|=67108866),ee}function z(ee,Q,ne,ue){return Q===null||Q.tag!==6?(Q=Bf(ne,ee.mode,ue),Q.return=ee,Q):(Q=y(Q,ne),Q.return=ee,Q)}function Z(ee,Q,ne,ue){var xe=ne.type;return xe===x?oe(ee,Q,ne.props.children,ue,ne.key):Q!==null&&(Q.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===L&&T0(xe)===Q.type)?(Q=y(Q,ne.props),rl(Q,ne),Q.return=ee,Q):(Q=Po(ne.type,ne.key,ne.props,null,ee.mode,ue),rl(Q,ne),Q.return=ee,Q)}function re(ee,Q,ne,ue){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==ne.containerInfo||Q.stateNode.implementation!==ne.implementation?(Q=Ff(ne,ee.mode,ue),Q.return=ee,Q):(Q=y(Q,ne.children||[]),Q.return=ee,Q)}function oe(ee,Q,ne,ue,xe){return Q===null||Q.tag!==7?(Q=Di(ne,ee.mode,ue,xe),Q.return=ee,Q):(Q=y(Q,ne),Q.return=ee,Q)}function de(ee,Q,ne){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=Bf(""+Q,ee.mode,ne),Q.return=ee,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case m:return ne=Po(Q.type,Q.key,Q.props,null,ee.mode,ne),rl(ne,Q),ne.return=ee,ne;case b:return Q=Ff(Q,ee.mode,ne),Q.return=ee,Q;case L:var ue=Q._init;return Q=ue(Q._payload),de(ee,Q,ne)}if($(Q)||B(Q))return Q=Di(Q,ee.mode,ne,null),Q.return=ee,Q;if(typeof Q.then=="function")return de(ee,ru(Q),ne);if(Q.$$typeof===S)return de(ee,Vo(ee,Q),ne);iu(ee,Q)}return null}function ie(ee,Q,ne,ue){var xe=Q!==null?Q.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return xe!==null?null:z(ee,Q,""+ne,ue);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case m:return ne.key===xe?Z(ee,Q,ne,ue):null;case b:return ne.key===xe?re(ee,Q,ne,ue):null;case L:return xe=ne._init,ne=xe(ne._payload),ie(ee,Q,ne,ue)}if($(ne)||B(ne))return xe!==null?null:oe(ee,Q,ne,ue,null);if(typeof ne.then=="function")return ie(ee,Q,ru(ne),ue);if(ne.$$typeof===S)return ie(ee,Q,Vo(ee,ne),ue);iu(ee,ne)}return null}function ae(ee,Q,ne,ue,xe){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return ee=ee.get(ne)||null,z(Q,ee,""+ue,xe);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case m:return ee=ee.get(ue.key===null?ne:ue.key)||null,Z(Q,ee,ue,xe);case b:return ee=ee.get(ue.key===null?ne:ue.key)||null,re(Q,ee,ue,xe);case L:var Fe=ue._init;return ue=Fe(ue._payload),ae(ee,Q,ne,ue,xe)}if($(ue)||B(ue))return ee=ee.get(ne)||null,oe(Q,ee,ue,xe,null);if(typeof ue.then=="function")return ae(ee,Q,ne,ru(ue),xe);if(ue.$$typeof===S)return ae(ee,Q,ne,Vo(Q,ue),xe);iu(Q,ue)}return null}function Re(ee,Q,ne,ue){for(var xe=null,Fe=null,ke=Q,Me=Q=0,jt=null;ke!==null&&Me<ne.length;Me++){ke.index>Me?(jt=ke,ke=null):jt=ke.sibling;var Ye=ie(ee,ke,ne[Me],ue);if(Ye===null){ke===null&&(ke=jt);break}i&&ke&&Ye.alternate===null&&a(ee,ke),Q=v(Ye,Q,Me),Fe===null?xe=Ye:Fe.sibling=Ye,Fe=Ye,ke=jt}if(Me===ne.length)return u(ee,ke),Ke&&zi(ee,Me),xe;if(ke===null){for(;Me<ne.length;Me++)ke=de(ee,ne[Me],ue),ke!==null&&(Q=v(ke,Q,Me),Fe===null?xe=ke:Fe.sibling=ke,Fe=ke);return Ke&&zi(ee,Me),xe}for(ke=h(ke);Me<ne.length;Me++)jt=ae(ke,ee,Me,ne[Me],ue),jt!==null&&(i&&jt.alternate!==null&&ke.delete(jt.key===null?Me:jt.key),Q=v(jt,Q,Me),Fe===null?xe=jt:Fe.sibling=jt,Fe=jt);return i&&ke.forEach(function(fi){return a(ee,fi)}),Ke&&zi(ee,Me),xe}function Oe(ee,Q,ne,ue){if(ne==null)throw Error(r(151));for(var xe=null,Fe=null,ke=Q,Me=Q=0,jt=null,Ye=ne.next();ke!==null&&!Ye.done;Me++,Ye=ne.next()){ke.index>Me?(jt=ke,ke=null):jt=ke.sibling;var fi=ie(ee,ke,Ye.value,ue);if(fi===null){ke===null&&(ke=jt);break}i&&ke&&fi.alternate===null&&a(ee,ke),Q=v(fi,Q,Me),Fe===null?xe=fi:Fe.sibling=fi,Fe=fi,ke=jt}if(Ye.done)return u(ee,ke),Ke&&zi(ee,Me),xe;if(ke===null){for(;!Ye.done;Me++,Ye=ne.next())Ye=de(ee,Ye.value,ue),Ye!==null&&(Q=v(Ye,Q,Me),Fe===null?xe=Ye:Fe.sibling=Ye,Fe=Ye);return Ke&&zi(ee,Me),xe}for(ke=h(ke);!Ye.done;Me++,Ye=ne.next())Ye=ae(ke,ee,Me,Ye.value,ue),Ye!==null&&(i&&Ye.alternate!==null&&ke.delete(Ye.key===null?Me:Ye.key),Q=v(Ye,Q,Me),Fe===null?xe=Ye:Fe.sibling=Ye,Fe=Ye);return i&&ke.forEach(function(xT){return a(ee,xT)}),Ke&&zi(ee,Me),xe}function it(ee,Q,ne,ue){if(typeof ne=="object"&&ne!==null&&ne.type===x&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case m:e:{for(var xe=ne.key;Q!==null;){if(Q.key===xe){if(xe=ne.type,xe===x){if(Q.tag===7){u(ee,Q.sibling),ue=y(Q,ne.props.children),ue.return=ee,ee=ue;break e}}else if(Q.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===L&&T0(xe)===Q.type){u(ee,Q.sibling),ue=y(Q,ne.props),rl(ue,ne),ue.return=ee,ee=ue;break e}u(ee,Q);break}else a(ee,Q);Q=Q.sibling}ne.type===x?(ue=Di(ne.props.children,ee.mode,ue,ne.key),ue.return=ee,ee=ue):(ue=Po(ne.type,ne.key,ne.props,null,ee.mode,ue),rl(ue,ne),ue.return=ee,ee=ue)}return N(ee);case b:e:{for(xe=ne.key;Q!==null;){if(Q.key===xe)if(Q.tag===4&&Q.stateNode.containerInfo===ne.containerInfo&&Q.stateNode.implementation===ne.implementation){u(ee,Q.sibling),ue=y(Q,ne.children||[]),ue.return=ee,ee=ue;break e}else{u(ee,Q);break}else a(ee,Q);Q=Q.sibling}ue=Ff(ne,ee.mode,ue),ue.return=ee,ee=ue}return N(ee);case L:return xe=ne._init,ne=xe(ne._payload),it(ee,Q,ne,ue)}if($(ne))return Re(ee,Q,ne,ue);if(B(ne)){if(xe=B(ne),typeof xe!="function")throw Error(r(150));return ne=xe.call(ne),Oe(ee,Q,ne,ue)}if(typeof ne.then=="function")return it(ee,Q,ru(ne),ue);if(ne.$$typeof===S)return it(ee,Q,Vo(ee,ne),ue);iu(ee,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,Q!==null&&Q.tag===6?(u(ee,Q.sibling),ue=y(Q,ne),ue.return=ee,ee=ue):(u(ee,Q),ue=Bf(ne,ee.mode,ue),ue.return=ee,ee=ue),N(ee)):u(ee,Q)}return function(ee,Q,ne,ue){try{nl=0;var xe=it(ee,Q,ne,ue);return Ra=null,xe}catch(ke){if(ke===Zs||ke===Go)throw ke;var Fe=fn(29,ke,null,ee.mode);return Fe.lanes=ue,Fe.return=ee,Fe}finally{}}}var Da=C0(!0),N0=C0(!1),Cn=G(null),er=null;function Qr(i){var a=i.alternate;T(Ot,Ot.current&1),T(Cn,i),er===null&&(a===null||Ca.current!==null||a.memoizedState!==null)&&(er=i)}function O0(i){if(i.tag===22){if(T(Ot,Ot.current),T(Cn,i),er===null){var a=i.alternate;a!==null&&a.memoizedState!==null&&(er=i)}}else Kr()}function Kr(){T(Ot,Ot.current),T(Cn,Cn.current)}function Sr(i){te(Cn),er===i&&(er=null),te(Ot)}var Ot=G(0);function au(i){for(var a=i;a!==null;){if(a.tag===13){var u=a.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||lh(u)))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}function bd(i,a,u,h){a=i.memoizedState,u=u(h,a),u=u==null?a:p({},a,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var vd={enqueueSetState:function(i,a,u){i=i._reactInternals;var h=gn(),y=Zr(h);y.payload=a,u!=null&&(y.callback=u),a=Yr(i,y,h),a!==null&&(mn(a,i,h),Xs(a,i,h))},enqueueReplaceState:function(i,a,u){i=i._reactInternals;var h=gn(),y=Zr(h);y.tag=1,y.payload=a,u!=null&&(y.callback=u),a=Yr(i,y,h),a!==null&&(mn(a,i,h),Xs(a,i,h))},enqueueForceUpdate:function(i,a){i=i._reactInternals;var u=gn(),h=Zr(u);h.tag=2,a!=null&&(h.callback=a),a=Yr(i,h,u),a!==null&&(mn(a,i,u),Xs(a,i,u))}};function M0(i,a,u,h,y,v,N){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(h,v,N):a.prototype&&a.prototype.isPureReactComponent?!Fs(u,h)||!Fs(y,v):!0}function R0(i,a,u,h){i=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(u,h),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(u,h),a.state!==i&&vd.enqueueReplaceState(a,a.state,null)}function Hi(i,a){var u=a;if("ref"in a){u={};for(var h in a)h!=="ref"&&(u[h]=a[h])}if(i=i.defaultProps){u===a&&(u=p({},u));for(var y in i)u[y]===void 0&&(u[y]=i[y])}return u}var su=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)};function D0(i){su(i)}function j0(i){console.error(i)}function z0(i){su(i)}function lu(i,a){try{var u=i.onUncaughtError;u(a.value,{componentStack:a.stack})}catch(h){setTimeout(function(){throw h})}}function L0(i,a,u){try{var h=i.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function xd(i,a,u){return u=Zr(u),u.tag=3,u.payload={element:null},u.callback=function(){lu(i,a)},u}function I0(i){return i=Zr(i),i.tag=3,i}function B0(i,a,u,h){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var v=h.value;i.payload=function(){return y(v)},i.callback=function(){L0(a,u,h)}}var N=u.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(i.callback=function(){L0(a,u,h),typeof y!="function"&&(ri===null?ri=new Set([this]):ri.add(this));var z=h.stack;this.componentDidCatch(h.value,{componentStack:z!==null?z:""})})}function xA(i,a,u,h,y){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(a=u.alternate,a!==null&&Vs(a,u,y,!0),u=Cn.current,u!==null){switch(u.tag){case 13:return er===null?Vd():u.alternate===null&&mt===0&&(mt=3),u.flags&=-257,u.flags|=65536,u.lanes=y,h===Xf?u.flags|=16384:(a=u.updateQueue,a===null?u.updateQueue=new Set([h]):a.add(h),Gd(i,h,y)),!1;case 22:return u.flags|=65536,h===Xf?u.flags|=16384:(a=u.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=a):(u=a.retryQueue,u===null?a.retryQueue=new Set([h]):u.add(h)),Gd(i,h,y)),!1}throw Error(r(435,u.tag))}return Gd(i,h,y),Vd(),!1}if(Ke)return a=Cn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=y,h!==Hf&&(i=Error(r(422),{cause:h}),$s(kn(i,u)))):(h!==Hf&&(a=Error(r(423),{cause:h}),$s(kn(a,u))),i=i.current.alternate,i.flags|=65536,y&=-y,i.lanes|=y,h=kn(h,u),y=xd(i.stateNode,h,y),Jf(i,y),mt!==4&&(mt=2)),!1;var v=Error(r(520),{cause:h});if(v=kn(v,u),cl===null?cl=[v]:cl.push(v),mt!==4&&(mt=2),a===null)return!0;h=kn(h,u),u=a;do{switch(u.tag){case 3:return u.flags|=65536,i=y&-y,u.lanes|=i,i=xd(u.stateNode,h,i),Jf(u,i),!1;case 1:if(a=u.type,v=u.stateNode,(u.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(ri===null||!ri.has(v))))return u.flags|=65536,y&=-y,u.lanes|=y,y=I0(y),B0(y,i,u,h),Jf(u,y),!1}u=u.return}while(u!==null);return!1}var F0=Error(r(461)),Rt=!1;function zt(i,a,u,h){a.child=i===null?N0(a,null,u,h):Da(a,i.child,u,h)}function P0(i,a,u,h,y){u=u.render;var v=a.ref;if("ref"in h){var N={};for(var z in h)z!=="ref"&&(N[z]=h[z])}else N=h;return Fi(a),h=rd(i,a,u,N,v,y),z=id(),i!==null&&!Rt?(ad(i,a,y),kr(i,a,y)):(Ke&&z&&Pf(a),a.flags|=1,zt(i,a,h,y),a.child)}function U0(i,a,u,h,y){if(i===null){var v=u.type;return typeof v=="function"&&!If(v)&&v.defaultProps===void 0&&u.compare===null?(a.tag=15,a.type=v,H0(i,a,v,h,y)):(i=Po(u.type,null,h,a,a.mode,y),i.ref=a.ref,i.return=a,a.child=i)}if(v=i.child,!Cd(i,y)){var N=v.memoizedProps;if(u=u.compare,u=u!==null?u:Fs,u(N,h)&&i.ref===a.ref)return kr(i,a,y)}return a.flags|=1,i=yr(v,h),i.ref=a.ref,i.return=a,a.child=i}function H0(i,a,u,h,y){if(i!==null){var v=i.memoizedProps;if(Fs(v,h)&&i.ref===a.ref)if(Rt=!1,a.pendingProps=h=v,Cd(i,y))(i.flags&131072)!==0&&(Rt=!0);else return a.lanes=i.lanes,kr(i,a,y)}return wd(i,a,u,h,y)}function $0(i,a,u){var h=a.pendingProps,y=h.children,v=i!==null?i.memoizedState:null;if(h.mode==="hidden"){if((a.flags&128)!==0){if(h=v!==null?v.baseLanes|u:u,i!==null){for(y=a.child=i.child,v=0;y!==null;)v=v|y.lanes|y.childLanes,y=y.sibling;a.childLanes=v&~h}else a.childLanes=0,a.child=null;return V0(i,a,h,u)}if((u&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},i!==null&&qo(a,v!==null?v.cachePool:null),v!==null?Hy(a,v):ed(),O0(a);else return a.lanes=a.childLanes=536870912,V0(i,a,v!==null?v.baseLanes|u:u,u)}else v!==null?(qo(a,v.cachePool),Hy(a,v),Kr(),a.memoizedState=null):(i!==null&&qo(a,null),ed(),Kr());return zt(i,a,y,u),a.child}function V0(i,a,u,h){var y=Yf();return y=y===null?null:{parent:Nt._currentValue,pool:y},a.memoizedState={baseLanes:u,cachePool:y},i!==null&&qo(a,null),ed(),O0(a),i!==null&&Vs(i,a,h,!0),null}function ou(i,a){var u=a.ref;if(u===null)i!==null&&i.ref!==null&&(a.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(i===null||i.ref!==u)&&(a.flags|=4194816)}}function wd(i,a,u,h,y){return Fi(a),u=rd(i,a,u,h,void 0,y),h=id(),i!==null&&!Rt?(ad(i,a,y),kr(i,a,y)):(Ke&&h&&Pf(a),a.flags|=1,zt(i,a,u,y),a.child)}function q0(i,a,u,h,y,v){return Fi(a),a.updateQueue=null,u=Vy(a,h,u,y),$y(i),h=id(),i!==null&&!Rt?(ad(i,a,v),kr(i,a,v)):(Ke&&h&&Pf(a),a.flags|=1,zt(i,a,u,v),a.child)}function G0(i,a,u,h,y){if(Fi(a),a.stateNode===null){var v=Sa,N=u.contextType;typeof N=="object"&&N!==null&&(v=Ht(N)),v=new u(h,v),a.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=vd,a.stateNode=v,v._reactInternals=a,v=a.stateNode,v.props=h,v.state=a.memoizedState,v.refs={},Qf(a),N=u.contextType,v.context=typeof N=="object"&&N!==null?Ht(N):Sa,v.state=a.memoizedState,N=u.getDerivedStateFromProps,typeof N=="function"&&(bd(a,u,N,h),v.state=a.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(N=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),N!==v.state&&vd.enqueueReplaceState(v,v.state,null),Ks(a,h,v,y),Qs(),v.state=a.memoizedState),typeof v.componentDidMount=="function"&&(a.flags|=4194308),h=!0}else if(i===null){v=a.stateNode;var z=a.memoizedProps,Z=Hi(u,z);v.props=Z;var re=v.context,oe=u.contextType;N=Sa,typeof oe=="object"&&oe!==null&&(N=Ht(oe));var de=u.getDerivedStateFromProps;oe=typeof de=="function"||typeof v.getSnapshotBeforeUpdate=="function",z=a.pendingProps!==z,oe||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(z||re!==N)&&R0(a,v,h,N),Gr=!1;var ie=a.memoizedState;v.state=ie,Ks(a,h,v,y),Qs(),re=a.memoizedState,z||ie!==re||Gr?(typeof de=="function"&&(bd(a,u,de,h),re=a.memoizedState),(Z=Gr||M0(a,u,Z,h,ie,re,N))?(oe||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(a.flags|=4194308)):(typeof v.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=h,a.memoizedState=re),v.props=h,v.state=re,v.context=N,h=Z):(typeof v.componentDidMount=="function"&&(a.flags|=4194308),h=!1)}else{v=a.stateNode,Kf(i,a),N=a.memoizedProps,oe=Hi(u,N),v.props=oe,de=a.pendingProps,ie=v.context,re=u.contextType,Z=Sa,typeof re=="object"&&re!==null&&(Z=Ht(re)),z=u.getDerivedStateFromProps,(re=typeof z=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N!==de||ie!==Z)&&R0(a,v,h,Z),Gr=!1,ie=a.memoizedState,v.state=ie,Ks(a,h,v,y),Qs();var ae=a.memoizedState;N!==de||ie!==ae||Gr||i!==null&&i.dependencies!==null&&$o(i.dependencies)?(typeof z=="function"&&(bd(a,u,z,h),ae=a.memoizedState),(oe=Gr||M0(a,u,oe,h,ie,ae,Z)||i!==null&&i.dependencies!==null&&$o(i.dependencies))?(re||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(h,ae,Z),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(h,ae,Z)),typeof v.componentDidUpdate=="function"&&(a.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof v.componentDidUpdate!="function"||N===i.memoizedProps&&ie===i.memoizedState||(a.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||N===i.memoizedProps&&ie===i.memoizedState||(a.flags|=1024),a.memoizedProps=h,a.memoizedState=ae),v.props=h,v.state=ae,v.context=Z,h=oe):(typeof v.componentDidUpdate!="function"||N===i.memoizedProps&&ie===i.memoizedState||(a.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||N===i.memoizedProps&&ie===i.memoizedState||(a.flags|=1024),h=!1)}return v=h,ou(i,a),h=(a.flags&128)!==0,v||h?(v=a.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:v.render(),a.flags|=1,i!==null&&h?(a.child=Da(a,i.child,null,y),a.child=Da(a,null,u,y)):zt(i,a,u,y),a.memoizedState=v.state,i=a.child):i=kr(i,a,y),i}function Z0(i,a,u,h){return Hs(),a.flags|=256,zt(i,a,u,h),a.child}var _d={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sd(i){return{baseLanes:i,cachePool:jy()}}function kd(i,a,u){return i=i!==null?i.childLanes&~u:0,a&&(i|=Nn),i}function Y0(i,a,u){var h=a.pendingProps,y=!1,v=(a.flags&128)!==0,N;if((N=v)||(N=i!==null&&i.memoizedState===null?!1:(Ot.current&2)!==0),N&&(y=!0,a.flags&=-129),N=(a.flags&32)!==0,a.flags&=-33,i===null){if(Ke){if(y?Qr(a):Kr(),Ke){var z=gt,Z;if(Z=z){e:{for(Z=z,z=Wn;Z.nodeType!==8;){if(!z){z=null;break e}if(Z=Bn(Z.nextSibling),Z===null){z=null;break e}}z=Z}z!==null?(a.memoizedState={dehydrated:z,treeContext:ji!==null?{id:br,overflow:vr}:null,retryLane:536870912,hydrationErrors:null},Z=fn(18,null,null,0),Z.stateNode=z,Z.return=a,a.child=Z,Yt=a,gt=null,Z=!0):Z=!1}Z||Ii(a)}if(z=a.memoizedState,z!==null&&(z=z.dehydrated,z!==null))return lh(z)?a.lanes=32:a.lanes=536870912,null;Sr(a)}return z=h.children,h=h.fallback,y?(Kr(),y=a.mode,z=uu({mode:"hidden",children:z},y),h=Di(h,y,u,null),z.return=a,h.return=a,z.sibling=h,a.child=z,y=a.child,y.memoizedState=Sd(u),y.childLanes=kd(i,N,u),a.memoizedState=_d,h):(Qr(a),Ed(a,z))}if(Z=i.memoizedState,Z!==null&&(z=Z.dehydrated,z!==null)){if(v)a.flags&256?(Qr(a),a.flags&=-257,a=Ad(i,a,u)):a.memoizedState!==null?(Kr(),a.child=i.child,a.flags|=128,a=null):(Kr(),y=h.fallback,z=a.mode,h=uu({mode:"visible",children:h.children},z),y=Di(y,z,u,null),y.flags|=2,h.return=a,y.return=a,h.sibling=y,a.child=h,Da(a,i.child,null,u),h=a.child,h.memoizedState=Sd(u),h.childLanes=kd(i,N,u),a.memoizedState=_d,a=y);else if(Qr(a),lh(z)){if(N=z.nextSibling&&z.nextSibling.dataset,N)var re=N.dgst;N=re,h=Error(r(419)),h.stack="",h.digest=N,$s({value:h,source:null,stack:null}),a=Ad(i,a,u)}else if(Rt||Vs(i,a,u,!1),N=(u&i.childLanes)!==0,Rt||N){if(N=ot,N!==null&&(h=u&-u,h=(h&42)!==0?1:ks(h),h=(h&(N.suspendedLanes|u))!==0?0:h,h!==0&&h!==Z.retryLane))throw Z.retryLane=h,_a(i,h),mn(N,i,h),F0;z.data==="$?"||Vd(),a=Ad(i,a,u)}else z.data==="$?"?(a.flags|=192,a.child=i.child,a=null):(i=Z.treeContext,gt=Bn(z.nextSibling),Yt=a,Ke=!0,Li=null,Wn=!1,i!==null&&(An[Tn++]=br,An[Tn++]=vr,An[Tn++]=ji,br=i.id,vr=i.overflow,ji=a),a=Ed(a,h.children),a.flags|=4096);return a}return y?(Kr(),y=h.fallback,z=a.mode,Z=i.child,re=Z.sibling,h=yr(Z,{mode:"hidden",children:h.children}),h.subtreeFlags=Z.subtreeFlags&65011712,re!==null?y=yr(re,y):(y=Di(y,z,u,null),y.flags|=2),y.return=a,h.return=a,h.sibling=y,a.child=h,h=y,y=a.child,z=i.child.memoizedState,z===null?z=Sd(u):(Z=z.cachePool,Z!==null?(re=Nt._currentValue,Z=Z.parent!==re?{parent:re,pool:re}:Z):Z=jy(),z={baseLanes:z.baseLanes|u,cachePool:Z}),y.memoizedState=z,y.childLanes=kd(i,N,u),a.memoizedState=_d,h):(Qr(a),u=i.child,i=u.sibling,u=yr(u,{mode:"visible",children:h.children}),u.return=a,u.sibling=null,i!==null&&(N=a.deletions,N===null?(a.deletions=[i],a.flags|=16):N.push(i)),a.child=u,a.memoizedState=null,u)}function Ed(i,a){return a=uu({mode:"visible",children:a},i.mode),a.return=i,i.child=a}function uu(i,a){return i=fn(22,i,null,a),i.lanes=0,i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},i}function Ad(i,a,u){return Da(a,i.child,null,u),i=Ed(a,a.pendingProps.children),i.flags|=2,a.memoizedState=null,i}function X0(i,a,u){i.lanes|=a;var h=i.alternate;h!==null&&(h.lanes|=a),Vf(i.return,a,u)}function Td(i,a,u,h,y){var v=i.memoizedState;v===null?i.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:y}:(v.isBackwards=a,v.rendering=null,v.renderingStartTime=0,v.last=h,v.tail=u,v.tailMode=y)}function Q0(i,a,u){var h=a.pendingProps,y=h.revealOrder,v=h.tail;if(zt(i,a,h.children,u),h=Ot.current,(h&2)!==0)h=h&1|2,a.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=a.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&X0(i,u,a);else if(i.tag===19)X0(i,u,a);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break e;for(;i.sibling===null;){if(i.return===null||i.return===a)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}h&=1}switch(T(Ot,h),y){case"forwards":for(u=a.child,y=null;u!==null;)i=u.alternate,i!==null&&au(i)===null&&(y=u),u=u.sibling;u=y,u===null?(y=a.child,a.child=null):(y=u.sibling,u.sibling=null),Td(a,!1,y,u,v);break;case"backwards":for(u=null,y=a.child,a.child=null;y!==null;){if(i=y.alternate,i!==null&&au(i)===null){a.child=y;break}i=y.sibling,y.sibling=u,u=y,y=i}Td(a,!0,u,null,v);break;case"together":Td(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function kr(i,a,u){if(i!==null&&(a.dependencies=i.dependencies),ni|=a.lanes,(u&a.childLanes)===0)if(i!==null){if(Vs(i,a,u,!1),(u&a.childLanes)===0)return null}else return null;if(i!==null&&a.child!==i.child)throw Error(r(153));if(a.child!==null){for(i=a.child,u=yr(i,i.pendingProps),a.child=u,u.return=a;i.sibling!==null;)i=i.sibling,u=u.sibling=yr(i,i.pendingProps),u.return=a;u.sibling=null}return a.child}function Cd(i,a){return(i.lanes&a)!==0?!0:(i=i.dependencies,!!(i!==null&&$o(i)))}function wA(i,a,u){switch(a.tag){case 3:fe(a,a.stateNode.containerInfo),qr(a,Nt,i.memoizedState.cache),Hs();break;case 27:case 5:Ae(a);break;case 4:fe(a,a.stateNode.containerInfo);break;case 10:qr(a,a.type,a.memoizedProps.value);break;case 13:var h=a.memoizedState;if(h!==null)return h.dehydrated!==null?(Qr(a),a.flags|=128,null):(u&a.child.childLanes)!==0?Y0(i,a,u):(Qr(a),i=kr(i,a,u),i!==null?i.sibling:null);Qr(a);break;case 19:var y=(i.flags&128)!==0;if(h=(u&a.childLanes)!==0,h||(Vs(i,a,u,!1),h=(u&a.childLanes)!==0),y){if(h)return Q0(i,a,u);a.flags|=128}if(y=a.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),T(Ot,Ot.current),h)break;return null;case 22:case 23:return a.lanes=0,$0(i,a,u);case 24:qr(a,Nt,i.memoizedState.cache)}return kr(i,a,u)}function K0(i,a,u){if(i!==null)if(i.memoizedProps!==a.pendingProps)Rt=!0;else{if(!Cd(i,u)&&(a.flags&128)===0)return Rt=!1,wA(i,a,u);Rt=(i.flags&131072)!==0}else Rt=!1,Ke&&(a.flags&1048576)!==0&&Ty(a,Ho,a.index);switch(a.lanes=0,a.tag){case 16:e:{i=a.pendingProps;var h=a.elementType,y=h._init;if(h=y(h._payload),a.type=h,typeof h=="function")If(h)?(i=Hi(h,i),a.tag=1,a=G0(null,a,h,i,u)):(a.tag=0,a=wd(null,a,h,i,u));else{if(h!=null){if(y=h.$$typeof,y===O){a.tag=11,a=P0(null,a,h,i,u);break e}else if(y===F){a.tag=14,a=U0(null,a,h,i,u);break e}}throw a=R(h)||h,Error(r(306,a,""))}}return a;case 0:return wd(i,a,a.type,a.pendingProps,u);case 1:return h=a.type,y=Hi(h,a.pendingProps),G0(i,a,h,y,u);case 3:e:{if(fe(a,a.stateNode.containerInfo),i===null)throw Error(r(387));h=a.pendingProps;var v=a.memoizedState;y=v.element,Kf(i,a),Ks(a,h,null,u);var N=a.memoizedState;if(h=N.cache,qr(a,Nt,h),h!==v.cache&&qf(a,[Nt],u,!0),Qs(),h=N.element,v.isDehydrated)if(v={element:h,isDehydrated:!1,cache:N.cache},a.updateQueue.baseState=v,a.memoizedState=v,a.flags&256){a=Z0(i,a,h,u);break e}else if(h!==y){y=kn(Error(r(424)),a),$s(y),a=Z0(i,a,h,u);break e}else{switch(i=a.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(gt=Bn(i.firstChild),Yt=a,Ke=!0,Li=null,Wn=!0,u=N0(a,null,h,u),a.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Hs(),h===y){a=kr(i,a,u);break e}zt(i,a,h,u)}a=a.child}return a;case 26:return ou(i,a),i===null?(u=tv(a.type,null,a.pendingProps,null))?a.memoizedState=u:Ke||(u=a.type,i=a.pendingProps,h=Su(J.current).createElement(u),h[Mt]=a,h[Ut]=i,It(h,u,i),_t(h),a.stateNode=h):a.memoizedState=tv(a.type,i.memoizedProps,a.pendingProps,i.memoizedState),null;case 27:return Ae(a),i===null&&Ke&&(h=a.stateNode=Jb(a.type,a.pendingProps,J.current),Yt=a,Wn=!0,y=gt,si(a.type)?(oh=y,gt=Bn(h.firstChild)):gt=y),zt(i,a,a.pendingProps.children,u),ou(i,a),i===null&&(a.flags|=4194304),a.child;case 5:return i===null&&Ke&&((y=h=gt)&&(h=XA(h,a.type,a.pendingProps,Wn),h!==null?(a.stateNode=h,Yt=a,gt=Bn(h.firstChild),Wn=!1,y=!0):y=!1),y||Ii(a)),Ae(a),y=a.type,v=a.pendingProps,N=i!==null?i.memoizedProps:null,h=v.children,ih(y,v)?h=null:N!==null&&ih(y,N)&&(a.flags|=32),a.memoizedState!==null&&(y=rd(i,a,hA,null,null,u),vl._currentValue=y),ou(i,a),zt(i,a,h,u),a.child;case 6:return i===null&&Ke&&((i=u=gt)&&(u=QA(u,a.pendingProps,Wn),u!==null?(a.stateNode=u,Yt=a,gt=null,i=!0):i=!1),i||Ii(a)),null;case 13:return Y0(i,a,u);case 4:return fe(a,a.stateNode.containerInfo),h=a.pendingProps,i===null?a.child=Da(a,null,h,u):zt(i,a,h,u),a.child;case 11:return P0(i,a,a.type,a.pendingProps,u);case 7:return zt(i,a,a.pendingProps,u),a.child;case 8:return zt(i,a,a.pendingProps.children,u),a.child;case 12:return zt(i,a,a.pendingProps.children,u),a.child;case 10:return h=a.pendingProps,qr(a,a.type,h.value),zt(i,a,h.children,u),a.child;case 9:return y=a.type._context,h=a.pendingProps.children,Fi(a),y=Ht(y),h=h(y),a.flags|=1,zt(i,a,h,u),a.child;case 14:return U0(i,a,a.type,a.pendingProps,u);case 15:return H0(i,a,a.type,a.pendingProps,u);case 19:return Q0(i,a,u);case 31:return h=a.pendingProps,u=a.mode,h={mode:h.mode,children:h.children},i===null?(u=uu(h,u),u.ref=a.ref,a.child=u,u.return=a,a=u):(u=yr(i.child,h),u.ref=a.ref,a.child=u,u.return=a,a=u),a;case 22:return $0(i,a,u);case 24:return Fi(a),h=Ht(Nt),i===null?(y=Yf(),y===null&&(y=ot,v=Gf(),y.pooledCache=v,v.refCount++,v!==null&&(y.pooledCacheLanes|=u),y=v),a.memoizedState={parent:h,cache:y},Qf(a),qr(a,Nt,y)):((i.lanes&u)!==0&&(Kf(i,a),Ks(a,null,null,u),Qs()),y=i.memoizedState,v=a.memoizedState,y.parent!==h?(y={parent:h,cache:h},a.memoizedState=y,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=y),qr(a,Nt,h)):(h=v.cache,qr(a,Nt,h),h!==y.cache&&qf(a,[Nt],u,!0))),zt(i,a,a.pendingProps.children,u),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function Er(i){i.flags|=4}function J0(i,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!sv(a)){if(a=Cn.current,a!==null&&((Ve&4194048)===Ve?er!==null:(Ve&62914560)!==Ve&&(Ve&536870912)===0||a!==er))throw Ys=Xf,zy;i.flags|=8192}}function cu(i,a){a!==null&&(i.flags|=4),i.flags&16384&&(a=i.tag!==22?bo():536870912,i.lanes|=a,Ia|=a)}function il(i,a){if(!Ke)switch(i.tailMode){case"hidden":a=i.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?a||i.tail===null?i.tail=null:i.tail.sibling=null:h.sibling=null}}function pt(i){var a=i.alternate!==null&&i.alternate.child===i.child,u=0,h=0;if(a)for(var y=i.child;y!==null;)u|=y.lanes|y.childLanes,h|=y.subtreeFlags&65011712,h|=y.flags&65011712,y.return=i,y=y.sibling;else for(y=i.child;y!==null;)u|=y.lanes|y.childLanes,h|=y.subtreeFlags,h|=y.flags,y.return=i,y=y.sibling;return i.subtreeFlags|=h,i.childLanes=u,a}function _A(i,a,u){var h=a.pendingProps;switch(Uf(a),a.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pt(a),null;case 1:return pt(a),null;case 3:return u=a.stateNode,h=null,i!==null&&(h=i.memoizedState.cache),a.memoizedState.cache!==h&&(a.flags|=2048),wr(Nt),ye(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(Us(a)?Er(a):i===null||i.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Oy())),pt(a),null;case 26:return u=a.memoizedState,i===null?(Er(a),u!==null?(pt(a),J0(a,u)):(pt(a),a.flags&=-16777217)):u?u!==i.memoizedState?(Er(a),pt(a),J0(a,u)):(pt(a),a.flags&=-16777217):(i.memoizedProps!==h&&Er(a),pt(a),a.flags&=-16777217),null;case 27:Se(a),u=J.current;var y=a.type;if(i!==null&&a.stateNode!=null)i.memoizedProps!==h&&Er(a);else{if(!h){if(a.stateNode===null)throw Error(r(166));return pt(a),null}i=V.current,Us(a)?Cy(a):(i=Jb(y,h,u),a.stateNode=i,Er(a))}return pt(a),null;case 5:if(Se(a),u=a.type,i!==null&&a.stateNode!=null)i.memoizedProps!==h&&Er(a);else{if(!h){if(a.stateNode===null)throw Error(r(166));return pt(a),null}if(i=V.current,Us(a))Cy(a);else{switch(y=Su(J.current),i){case 1:i=y.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:i=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":i=y.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":i=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":i=y.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof h.is=="string"?y.createElement("select",{is:h.is}):y.createElement("select"),h.multiple?i.multiple=!0:h.size&&(i.size=h.size);break;default:i=typeof h.is=="string"?y.createElement(u,{is:h.is}):y.createElement(u)}}i[Mt]=a,i[Ut]=h;e:for(y=a.child;y!==null;){if(y.tag===5||y.tag===6)i.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===a)break e;for(;y.sibling===null;){if(y.return===null||y.return===a)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}a.stateNode=i;e:switch(It(i,u,h),u){case"button":case"input":case"select":case"textarea":i=!!h.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Er(a)}}return pt(a),a.flags&=-16777217,null;case 6:if(i&&a.stateNode!=null)i.memoizedProps!==h&&Er(a);else{if(typeof h!="string"&&a.stateNode===null)throw Error(r(166));if(i=J.current,Us(a)){if(i=a.stateNode,u=a.memoizedProps,h=null,y=Yt,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}i[Mt]=a,i=!!(i.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||qb(i.nodeValue,u)),i||Ii(a)}else i=Su(i).createTextNode(h),i[Mt]=a,a.stateNode=i}return pt(a),null;case 13:if(h=a.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(y=Us(a),h!==null&&h.dehydrated!==null){if(i===null){if(!y)throw Error(r(318));if(y=a.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[Mt]=a}else Hs(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;pt(a),y=!1}else y=Oy(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=y),y=!0;if(!y)return a.flags&256?(Sr(a),a):(Sr(a),null)}if(Sr(a),(a.flags&128)!==0)return a.lanes=u,a;if(u=h!==null,i=i!==null&&i.memoizedState!==null,u){h=a.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool);var v=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(v=h.memoizedState.cachePool.pool),v!==y&&(h.flags|=2048)}return u!==i&&u&&(a.child.flags|=8192),cu(a,a.updateQueue),pt(a),null;case 4:return ye(),i===null&&Wd(a.stateNode.containerInfo),pt(a),null;case 10:return wr(a.type),pt(a),null;case 19:if(te(Ot),y=a.memoizedState,y===null)return pt(a),null;if(h=(a.flags&128)!==0,v=y.rendering,v===null)if(h)il(y,!1);else{if(mt!==0||i!==null&&(i.flags&128)!==0)for(i=a.child;i!==null;){if(v=au(i),v!==null){for(a.flags|=128,il(y,!1),i=v.updateQueue,a.updateQueue=i,cu(a,i),a.subtreeFlags=0,i=u,u=a.child;u!==null;)Ay(u,i),u=u.sibling;return T(Ot,Ot.current&1|2),a.child}i=i.sibling}y.tail!==null&&xt()>hu&&(a.flags|=128,h=!0,il(y,!1),a.lanes=4194304)}else{if(!h)if(i=au(v),i!==null){if(a.flags|=128,h=!0,i=i.updateQueue,a.updateQueue=i,cu(a,i),il(y,!0),y.tail===null&&y.tailMode==="hidden"&&!v.alternate&&!Ke)return pt(a),null}else 2*xt()-y.renderingStartTime>hu&&u!==536870912&&(a.flags|=128,h=!0,il(y,!1),a.lanes=4194304);y.isBackwards?(v.sibling=a.child,a.child=v):(i=y.last,i!==null?i.sibling=v:a.child=v,y.last=v)}return y.tail!==null?(a=y.tail,y.rendering=a,y.tail=a.sibling,y.renderingStartTime=xt(),a.sibling=null,i=Ot.current,T(Ot,h?i&1|2:i&1),a):(pt(a),null);case 22:case 23:return Sr(a),td(),h=a.memoizedState!==null,i!==null?i.memoizedState!==null!==h&&(a.flags|=8192):h&&(a.flags|=8192),h?(u&536870912)!==0&&(a.flags&128)===0&&(pt(a),a.subtreeFlags&6&&(a.flags|=8192)):pt(a),u=a.updateQueue,u!==null&&cu(a,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),h=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),h!==u&&(a.flags|=2048),i!==null&&te(Pi),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),a.memoizedState.cache!==u&&(a.flags|=2048),wr(Nt),pt(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function SA(i,a){switch(Uf(a),a.tag){case 1:return i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 3:return wr(Nt),ye(),i=a.flags,(i&65536)!==0&&(i&128)===0?(a.flags=i&-65537|128,a):null;case 26:case 27:case 5:return Se(a),null;case 13:if(Sr(a),i=a.memoizedState,i!==null&&i.dehydrated!==null){if(a.alternate===null)throw Error(r(340));Hs()}return i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 19:return te(Ot),null;case 4:return ye(),null;case 10:return wr(a.type),null;case 22:case 23:return Sr(a),td(),i!==null&&te(Pi),i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 24:return wr(Nt),null;case 25:return null;default:return null}}function W0(i,a){switch(Uf(a),a.tag){case 3:wr(Nt),ye();break;case 26:case 27:case 5:Se(a);break;case 4:ye();break;case 13:Sr(a);break;case 19:te(Ot);break;case 10:wr(a.type);break;case 22:case 23:Sr(a),td(),i!==null&&te(Pi);break;case 24:wr(Nt)}}function al(i,a){try{var u=a.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var y=h.next;u=y;do{if((u.tag&i)===i){h=void 0;var v=u.create,N=u.inst;h=v(),N.destroy=h}u=u.next}while(u!==y)}}catch(z){at(a,a.return,z)}}function Jr(i,a,u){try{var h=a.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var v=y.next;h=v;do{if((h.tag&i)===i){var N=h.inst,z=N.destroy;if(z!==void 0){N.destroy=void 0,y=a;var Z=u,re=z;try{re()}catch(oe){at(y,Z,oe)}}}h=h.next}while(h!==v)}}catch(oe){at(a,a.return,oe)}}function eb(i){var a=i.updateQueue;if(a!==null){var u=i.stateNode;try{Uy(a,u)}catch(h){at(i,i.return,h)}}}function tb(i,a,u){u.props=Hi(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(h){at(i,a,h)}}function sl(i,a){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var h=i.stateNode;break;case 30:h=i.stateNode;break;default:h=i.stateNode}typeof u=="function"?i.refCleanup=u(h):u.current=h}}catch(y){at(i,a,y)}}function tr(i,a){var u=i.ref,h=i.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(y){at(i,a,y)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){at(i,a,y)}else u.current=null}function nb(i){var a=i.type,u=i.memoizedProps,h=i.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(y){at(i,i.return,y)}}function Nd(i,a,u){try{var h=i.stateNode;VA(h,i.type,u,a),h[Ut]=a}catch(y){at(i,i.return,y)}}function rb(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&si(i.type)||i.tag===4}function Od(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||rb(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&si(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Md(i,a,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,a?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,a):(a=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,a.appendChild(i),u=u._reactRootContainer,u!=null||a.onclick!==null||(a.onclick=_u));else if(h!==4&&(h===27&&si(i.type)&&(u=i.stateNode,a=null),i=i.child,i!==null))for(Md(i,a,u),i=i.sibling;i!==null;)Md(i,a,u),i=i.sibling}function fu(i,a,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,a?u.insertBefore(i,a):u.appendChild(i);else if(h!==4&&(h===27&&si(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(fu(i,a,u),i=i.sibling;i!==null;)fu(i,a,u),i=i.sibling}function ib(i){var a=i.stateNode,u=i.memoizedProps;try{for(var h=i.type,y=a.attributes;y.length;)a.removeAttributeNode(y[0]);It(a,h,u),a[Mt]=i,a[Ut]=u}catch(v){at(i,i.return,v)}}var Ar=!1,vt=!1,Rd=!1,ab=typeof WeakSet=="function"?WeakSet:Set,Dt=null;function kA(i,a){if(i=i.containerInfo,nh=Nu,i=my(i),Of(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var y=h.anchorOffset,v=h.focusNode;h=h.focusOffset;try{u.nodeType,v.nodeType}catch{u=null;break e}var N=0,z=-1,Z=-1,re=0,oe=0,de=i,ie=null;t:for(;;){for(var ae;de!==u||y!==0&&de.nodeType!==3||(z=N+y),de!==v||h!==0&&de.nodeType!==3||(Z=N+h),de.nodeType===3&&(N+=de.nodeValue.length),(ae=de.firstChild)!==null;)ie=de,de=ae;for(;;){if(de===i)break t;if(ie===u&&++re===y&&(z=N),ie===v&&++oe===h&&(Z=N),(ae=de.nextSibling)!==null)break;de=ie,ie=de.parentNode}de=ae}u=z===-1||Z===-1?null:{start:z,end:Z}}else u=null}u=u||{start:0,end:0}}else u=null;for(rh={focusedElem:i,selectionRange:u},Nu=!1,Dt=a;Dt!==null;)if(a=Dt,i=a.child,(a.subtreeFlags&1024)!==0&&i!==null)i.return=a,Dt=i;else for(;Dt!==null;){switch(a=Dt,v=a.alternate,i=a.flags,a.tag){case 0:break;case 11:case 15:break;case 1:if((i&1024)!==0&&v!==null){i=void 0,u=a,y=v.memoizedProps,v=v.memoizedState,h=u.stateNode;try{var Re=Hi(u.type,y,u.elementType===u.type);i=h.getSnapshotBeforeUpdate(Re,v),h.__reactInternalSnapshotBeforeUpdate=i}catch(Oe){at(u,u.return,Oe)}}break;case 3:if((i&1024)!==0){if(i=a.stateNode.containerInfo,u=i.nodeType,u===9)sh(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":sh(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=a.sibling,i!==null){i.return=a.return,Dt=i;break}Dt=a.return}}function sb(i,a,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:Wr(i,u),h&4&&al(5,u);break;case 1:if(Wr(i,u),h&4)if(i=u.stateNode,a===null)try{i.componentDidMount()}catch(N){at(u,u.return,N)}else{var y=Hi(u.type,a.memoizedProps);a=a.memoizedState;try{i.componentDidUpdate(y,a,i.__reactInternalSnapshotBeforeUpdate)}catch(N){at(u,u.return,N)}}h&64&&eb(u),h&512&&sl(u,u.return);break;case 3:if(Wr(i,u),h&64&&(i=u.updateQueue,i!==null)){if(a=null,u.child!==null)switch(u.child.tag){case 27:case 5:a=u.child.stateNode;break;case 1:a=u.child.stateNode}try{Uy(i,a)}catch(N){at(u,u.return,N)}}break;case 27:a===null&&h&4&&ib(u);case 26:case 5:Wr(i,u),a===null&&h&4&&nb(u),h&512&&sl(u,u.return);break;case 12:Wr(i,u);break;case 13:Wr(i,u),h&4&&ub(i,u),h&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=DA.bind(null,u),KA(i,u))));break;case 22:if(h=u.memoizedState!==null||Ar,!h){a=a!==null&&a.memoizedState!==null||vt,y=Ar;var v=vt;Ar=h,(vt=a)&&!v?ei(i,u,(u.subtreeFlags&8772)!==0):Wr(i,u),Ar=y,vt=v}break;case 30:break;default:Wr(i,u)}}function lb(i){var a=i.alternate;a!==null&&(i.alternate=null,lb(a)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(a=i.stateNode,a!==null&&Ts(a)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var dt=null,nn=!1;function Tr(i,a,u){for(u=u.child;u!==null;)ob(i,a,u),u=u.sibling}function ob(i,a,u){if(he&&typeof he.onCommitFiberUnmount=="function")try{he.onCommitFiberUnmount(se,u)}catch{}switch(u.tag){case 26:vt||tr(u,a),Tr(i,a,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:vt||tr(u,a);var h=dt,y=nn;si(u.type)&&(dt=u.stateNode,nn=!1),Tr(i,a,u),gl(u.stateNode),dt=h,nn=y;break;case 5:vt||tr(u,a);case 6:if(h=dt,y=nn,dt=null,Tr(i,a,u),dt=h,nn=y,dt!==null)if(nn)try{(dt.nodeType===9?dt.body:dt.nodeName==="HTML"?dt.ownerDocument.body:dt).removeChild(u.stateNode)}catch(v){at(u,a,v)}else try{dt.removeChild(u.stateNode)}catch(v){at(u,a,v)}break;case 18:dt!==null&&(nn?(i=dt,Qb(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),Sl(i)):Qb(dt,u.stateNode));break;case 4:h=dt,y=nn,dt=u.stateNode.containerInfo,nn=!0,Tr(i,a,u),dt=h,nn=y;break;case 0:case 11:case 14:case 15:vt||Jr(2,u,a),vt||Jr(4,u,a),Tr(i,a,u);break;case 1:vt||(tr(u,a),h=u.stateNode,typeof h.componentWillUnmount=="function"&&tb(u,a,h)),Tr(i,a,u);break;case 21:Tr(i,a,u);break;case 22:vt=(h=vt)||u.memoizedState!==null,Tr(i,a,u),vt=h;break;default:Tr(i,a,u)}}function ub(i,a){if(a.memoizedState===null&&(i=a.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Sl(i)}catch(u){at(a,a.return,u)}}function EA(i){switch(i.tag){case 13:case 19:var a=i.stateNode;return a===null&&(a=i.stateNode=new ab),a;case 22:return i=i.stateNode,a=i._retryCache,a===null&&(a=i._retryCache=new ab),a;default:throw Error(r(435,i.tag))}}function Dd(i,a){var u=EA(i);a.forEach(function(h){var y=jA.bind(null,i,h);u.has(h)||(u.add(h),h.then(y,y))})}function dn(i,a){var u=a.deletions;if(u!==null)for(var h=0;h<u.length;h++){var y=u[h],v=i,N=a,z=N;e:for(;z!==null;){switch(z.tag){case 27:if(si(z.type)){dt=z.stateNode,nn=!1;break e}break;case 5:dt=z.stateNode,nn=!1;break e;case 3:case 4:dt=z.stateNode.containerInfo,nn=!0;break e}z=z.return}if(dt===null)throw Error(r(160));ob(v,N,y),dt=null,nn=!1,v=y.alternate,v!==null&&(v.return=null),y.return=null}if(a.subtreeFlags&13878)for(a=a.child;a!==null;)cb(a,i),a=a.sibling}var In=null;function cb(i,a){var u=i.alternate,h=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:dn(a,i),hn(i),h&4&&(Jr(3,i,i.return),al(3,i),Jr(5,i,i.return));break;case 1:dn(a,i),hn(i),h&512&&(vt||u===null||tr(u,u.return)),h&64&&Ar&&(i=i.updateQueue,i!==null&&(h=i.callbacks,h!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var y=In;if(dn(a,i),hn(i),h&512&&(vt||u===null||tr(u,u.return)),h&4){var v=u!==null?u.memoizedState:null;if(h=i.memoizedState,u===null)if(h===null)if(i.stateNode===null){e:{h=i.type,u=i.memoizedProps,y=y.ownerDocument||y;t:switch(h){case"title":v=y.getElementsByTagName("title")[0],(!v||v[Ni]||v[Mt]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=y.createElement(h),y.head.insertBefore(v,y.querySelector("head > title"))),It(v,h,u),v[Mt]=i,_t(v),h=v;break e;case"link":var N=iv("link","href",y).get(h+(u.href||""));if(N){for(var z=0;z<N.length;z++)if(v=N[z],v.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&v.getAttribute("rel")===(u.rel==null?null:u.rel)&&v.getAttribute("title")===(u.title==null?null:u.title)&&v.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){N.splice(z,1);break t}}v=y.createElement(h),It(v,h,u),y.head.appendChild(v);break;case"meta":if(N=iv("meta","content",y).get(h+(u.content||""))){for(z=0;z<N.length;z++)if(v=N[z],v.getAttribute("content")===(u.content==null?null:""+u.content)&&v.getAttribute("name")===(u.name==null?null:u.name)&&v.getAttribute("property")===(u.property==null?null:u.property)&&v.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&v.getAttribute("charset")===(u.charSet==null?null:u.charSet)){N.splice(z,1);break t}}v=y.createElement(h),It(v,h,u),y.head.appendChild(v);break;default:throw Error(r(468,h))}v[Mt]=i,_t(v),h=v}i.stateNode=h}else av(y,i.type,i.stateNode);else i.stateNode=rv(y,h,i.memoizedProps);else v!==h?(v===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):v.count--,h===null?av(y,i.type,i.stateNode):rv(y,h,i.memoizedProps)):h===null&&i.stateNode!==null&&Nd(i,i.memoizedProps,u.memoizedProps)}break;case 27:dn(a,i),hn(i),h&512&&(vt||u===null||tr(u,u.return)),u!==null&&h&4&&Nd(i,i.memoizedProps,u.memoizedProps);break;case 5:if(dn(a,i),hn(i),h&512&&(vt||u===null||tr(u,u.return)),i.flags&32){y=i.stateNode;try{ga(y,"")}catch(ae){at(i,i.return,ae)}}h&4&&i.stateNode!=null&&(y=i.memoizedProps,Nd(i,y,u!==null?u.memoizedProps:y)),h&1024&&(Rd=!0);break;case 6:if(dn(a,i),hn(i),h&4){if(i.stateNode===null)throw Error(r(162));h=i.memoizedProps,u=i.stateNode;try{u.nodeValue=h}catch(ae){at(i,i.return,ae)}}break;case 3:if(Au=null,y=In,In=ku(a.containerInfo),dn(a,i),In=y,hn(i),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Sl(a.containerInfo)}catch(ae){at(i,i.return,ae)}Rd&&(Rd=!1,fb(i));break;case 4:h=In,In=ku(i.stateNode.containerInfo),dn(a,i),hn(i),In=h;break;case 12:dn(a,i),hn(i);break;case 13:dn(a,i),hn(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Fd=xt()),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,Dd(i,h)));break;case 22:y=i.memoizedState!==null;var Z=u!==null&&u.memoizedState!==null,re=Ar,oe=vt;if(Ar=re||y,vt=oe||Z,dn(a,i),vt=oe,Ar=re,hn(i),h&8192)e:for(a=i.stateNode,a._visibility=y?a._visibility&-2:a._visibility|1,y&&(u===null||Z||Ar||vt||$i(i)),u=null,a=i;;){if(a.tag===5||a.tag===26){if(u===null){Z=u=a;try{if(v=Z.stateNode,y)N=v.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{z=Z.stateNode;var de=Z.memoizedProps.style,ie=de!=null&&de.hasOwnProperty("display")?de.display:null;z.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(ae){at(Z,Z.return,ae)}}}else if(a.tag===6){if(u===null){Z=a;try{Z.stateNode.nodeValue=y?"":Z.memoizedProps}catch(ae){at(Z,Z.return,ae)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===i)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break e;for(;a.sibling===null;){if(a.return===null||a.return===i)break e;u===a&&(u=null),a=a.return}u===a&&(u=null),a.sibling.return=a.return,a=a.sibling}h&4&&(h=i.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,Dd(i,u))));break;case 19:dn(a,i),hn(i),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,Dd(i,h)));break;case 30:break;case 21:break;default:dn(a,i),hn(i)}}function hn(i){var a=i.flags;if(a&2){try{for(var u,h=i.return;h!==null;){if(rb(h)){u=h;break}h=h.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var y=u.stateNode,v=Od(i);fu(i,v,y);break;case 5:var N=u.stateNode;u.flags&32&&(ga(N,""),u.flags&=-33);var z=Od(i);fu(i,z,N);break;case 3:case 4:var Z=u.stateNode.containerInfo,re=Od(i);Md(i,re,Z);break;default:throw Error(r(161))}}catch(oe){at(i,i.return,oe)}i.flags&=-3}a&4096&&(i.flags&=-4097)}function fb(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var a=i;fb(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),i=i.sibling}}function Wr(i,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)sb(i,a.alternate,a),a=a.sibling}function $i(i){for(i=i.child;i!==null;){var a=i;switch(a.tag){case 0:case 11:case 14:case 15:Jr(4,a,a.return),$i(a);break;case 1:tr(a,a.return);var u=a.stateNode;typeof u.componentWillUnmount=="function"&&tb(a,a.return,u),$i(a);break;case 27:gl(a.stateNode);case 26:case 5:tr(a,a.return),$i(a);break;case 22:a.memoizedState===null&&$i(a);break;case 30:$i(a);break;default:$i(a)}i=i.sibling}}function ei(i,a,u){for(u=u&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var h=a.alternate,y=i,v=a,N=v.flags;switch(v.tag){case 0:case 11:case 15:ei(y,v,u),al(4,v);break;case 1:if(ei(y,v,u),h=v,y=h.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(re){at(h,h.return,re)}if(h=v,y=h.updateQueue,y!==null){var z=h.stateNode;try{var Z=y.shared.hiddenCallbacks;if(Z!==null)for(y.shared.hiddenCallbacks=null,y=0;y<Z.length;y++)Py(Z[y],z)}catch(re){at(h,h.return,re)}}u&&N&64&&eb(v),sl(v,v.return);break;case 27:ib(v);case 26:case 5:ei(y,v,u),u&&h===null&&N&4&&nb(v),sl(v,v.return);break;case 12:ei(y,v,u);break;case 13:ei(y,v,u),u&&N&4&&ub(y,v);break;case 22:v.memoizedState===null&&ei(y,v,u),sl(v,v.return);break;case 30:break;default:ei(y,v,u)}a=a.sibling}}function jd(i,a){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(i=a.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&qs(u))}function zd(i,a){i=null,a.alternate!==null&&(i=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==i&&(a.refCount++,i!=null&&qs(i))}function nr(i,a,u,h){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)db(i,a,u,h),a=a.sibling}function db(i,a,u,h){var y=a.flags;switch(a.tag){case 0:case 11:case 15:nr(i,a,u,h),y&2048&&al(9,a);break;case 1:nr(i,a,u,h);break;case 3:nr(i,a,u,h),y&2048&&(i=null,a.alternate!==null&&(i=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==i&&(a.refCount++,i!=null&&qs(i)));break;case 12:if(y&2048){nr(i,a,u,h),i=a.stateNode;try{var v=a.memoizedProps,N=v.id,z=v.onPostCommit;typeof z=="function"&&z(N,a.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(Z){at(a,a.return,Z)}}else nr(i,a,u,h);break;case 13:nr(i,a,u,h);break;case 23:break;case 22:v=a.stateNode,N=a.alternate,a.memoizedState!==null?v._visibility&2?nr(i,a,u,h):ll(i,a):v._visibility&2?nr(i,a,u,h):(v._visibility|=2,ja(i,a,u,h,(a.subtreeFlags&10256)!==0)),y&2048&&jd(N,a);break;case 24:nr(i,a,u,h),y&2048&&zd(a.alternate,a);break;default:nr(i,a,u,h)}}function ja(i,a,u,h,y){for(y=y&&(a.subtreeFlags&10256)!==0,a=a.child;a!==null;){var v=i,N=a,z=u,Z=h,re=N.flags;switch(N.tag){case 0:case 11:case 15:ja(v,N,z,Z,y),al(8,N);break;case 23:break;case 22:var oe=N.stateNode;N.memoizedState!==null?oe._visibility&2?ja(v,N,z,Z,y):ll(v,N):(oe._visibility|=2,ja(v,N,z,Z,y)),y&&re&2048&&jd(N.alternate,N);break;case 24:ja(v,N,z,Z,y),y&&re&2048&&zd(N.alternate,N);break;default:ja(v,N,z,Z,y)}a=a.sibling}}function ll(i,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var u=i,h=a,y=h.flags;switch(h.tag){case 22:ll(u,h),y&2048&&jd(h.alternate,h);break;case 24:ll(u,h),y&2048&&zd(h.alternate,h);break;default:ll(u,h)}a=a.sibling}}var ol=8192;function za(i){if(i.subtreeFlags&ol)for(i=i.child;i!==null;)hb(i),i=i.sibling}function hb(i){switch(i.tag){case 26:za(i),i.flags&ol&&i.memoizedState!==null&&cT(In,i.memoizedState,i.memoizedProps);break;case 5:za(i);break;case 3:case 4:var a=In;In=ku(i.stateNode.containerInfo),za(i),In=a;break;case 22:i.memoizedState===null&&(a=i.alternate,a!==null&&a.memoizedState!==null?(a=ol,ol=16777216,za(i),ol=a):za(i));break;default:za(i)}}function pb(i){var a=i.alternate;if(a!==null&&(i=a.child,i!==null)){a.child=null;do a=i.sibling,i.sibling=null,i=a;while(i!==null)}}function ul(i){var a=i.deletions;if((i.flags&16)!==0){if(a!==null)for(var u=0;u<a.length;u++){var h=a[u];Dt=h,mb(h,i)}pb(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)gb(i),i=i.sibling}function gb(i){switch(i.tag){case 0:case 11:case 15:ul(i),i.flags&2048&&Jr(9,i,i.return);break;case 3:ul(i);break;case 12:ul(i);break;case 22:var a=i.stateNode;i.memoizedState!==null&&a._visibility&2&&(i.return===null||i.return.tag!==13)?(a._visibility&=-3,du(i)):ul(i);break;default:ul(i)}}function du(i){var a=i.deletions;if((i.flags&16)!==0){if(a!==null)for(var u=0;u<a.length;u++){var h=a[u];Dt=h,mb(h,i)}pb(i)}for(i=i.child;i!==null;){switch(a=i,a.tag){case 0:case 11:case 15:Jr(8,a,a.return),du(a);break;case 22:u=a.stateNode,u._visibility&2&&(u._visibility&=-3,du(a));break;default:du(a)}i=i.sibling}}function mb(i,a){for(;Dt!==null;){var u=Dt;switch(u.tag){case 0:case 11:case 15:Jr(8,u,a);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:qs(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,Dt=h;else e:for(u=i;Dt!==null;){h=Dt;var y=h.sibling,v=h.return;if(lb(h),h===u){Dt=null;break e}if(y!==null){y.return=v,Dt=y;break e}Dt=v}}}var AA={getCacheForType:function(i){var a=Ht(Nt),u=a.data.get(i);return u===void 0&&(u=i(),a.data.set(i,u)),u}},TA=typeof WeakMap=="function"?WeakMap:Map,We=0,ot=null,Ue=null,Ve=0,et=0,pn=null,ti=!1,La=!1,Ld=!1,Cr=0,mt=0,ni=0,Vi=0,Id=0,Nn=0,Ia=0,cl=null,rn=null,Bd=!1,Fd=0,hu=1/0,pu=null,ri=null,Lt=0,ii=null,Ba=null,Fa=0,Pd=0,Ud=null,yb=null,fl=0,Hd=null;function gn(){if((We&2)!==0&&Ve!==0)return Ve&-Ve;if(I.T!==null){var i=Aa;return i!==0?i:Xd()}return xo()}function bb(){Nn===0&&(Nn=(Ve&536870912)===0||Ke?yo():536870912);var i=Cn.current;return i!==null&&(i.flags|=32),Nn}function mn(i,a,u){(i===ot&&(et===2||et===9)||i.cancelPendingCommit!==null)&&(Pa(i,0),ai(i,Ve,Nn,!1)),Ci(i,u),((We&2)===0||i!==ot)&&(i===ot&&((We&2)===0&&(Vi|=u),mt===4&&ai(i,Ve,Nn,!1)),rr(i))}function vb(i,a,u){if((We&6)!==0)throw Error(r(327));var h=!u&&(a&124)===0&&(a&i.expiredLanes)===0||Kt(i,a),y=h?OA(i,a):qd(i,a,!0),v=h;do{if(y===0){La&&!h&&ai(i,a,0,!1);break}else{if(u=i.current.alternate,v&&!CA(u)){y=qd(i,a,!1),v=!1;continue}if(y===2){if(v=a,i.errorRecoveryDisabledLanes&v)var N=0;else N=i.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){a=N;e:{var z=i;y=cl;var Z=z.current.memoizedState.isDehydrated;if(Z&&(Pa(z,N).flags|=256),N=qd(z,N,!1),N!==2){if(Ld&&!Z){z.errorRecoveryDisabledLanes|=v,Vi|=v,y=4;break e}v=rn,rn=y,v!==null&&(rn===null?rn=v:rn.push.apply(rn,v))}y=N}if(v=!1,y!==2)continue}}if(y===1){Pa(i,0),ai(i,a,0,!0);break}e:{switch(h=i,v=y,v){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a)break;case 6:ai(h,a,Nn,!ti);break e;case 2:rn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(y=Fd+300-xt(),10<y)){if(ai(h,a,Nn,!ti),wt(h,0,!0)!==0)break e;h.timeoutHandle=Yb(xb.bind(null,h,u,rn,pu,Bd,a,Nn,Vi,Ia,ti,v,2,-0,0),y);break e}xb(h,u,rn,pu,Bd,a,Nn,Vi,Ia,ti,v,0,-0,0)}}break}while(!0);rr(i)}function xb(i,a,u,h,y,v,N,z,Z,re,oe,de,ie,ae){if(i.timeoutHandle=-1,de=a.subtreeFlags,(de&8192||(de&16785408)===16785408)&&(bl={stylesheets:null,count:0,unsuspend:uT},hb(a),de=fT(),de!==null)){i.cancelPendingCommit=de(Tb.bind(null,i,a,v,u,h,y,N,z,Z,oe,1,ie,ae)),ai(i,v,N,!re);return}Tb(i,a,v,u,h,y,N,z,Z)}function CA(i){for(var a=i;;){var u=a.tag;if((u===0||u===11||u===15)&&a.flags&16384&&(u=a.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var y=u[h],v=y.getSnapshot;y=y.value;try{if(!cn(v(),y))return!1}catch{return!1}}if(u=a.child,a.subtreeFlags&16384&&u!==null)u.return=a,a=u;else{if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function ai(i,a,u,h){a&=~Id,a&=~Vi,i.suspendedLanes|=a,i.pingedLanes&=~a,h&&(i.warmLanes|=a),h=i.expirationTimes;for(var y=a;0<y;){var v=31-Te(y),N=1<<v;h[v]=-1,y&=~N}u!==0&&Ss(i,u,a)}function gu(){return(We&6)===0?(dl(0),!1):!0}function $d(){if(Ue!==null){if(et===0)var i=Ue.return;else i=Ue,xr=Bi=null,sd(i),Ra=null,nl=0,i=Ue;for(;i!==null;)W0(i.alternate,i),i=i.return;Ue=null}}function Pa(i,a){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,GA(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),$d(),ot=i,Ue=u=yr(i.current,null),Ve=a,et=0,pn=null,ti=!1,La=Kt(i,a),Ld=!1,Ia=Nn=Id=Vi=ni=mt=0,rn=cl=null,Bd=!1,(a&8)!==0&&(a|=a&32);var h=i.entangledLanes;if(h!==0)for(i=i.entanglements,h&=a;0<h;){var y=31-Te(h),v=1<<y;a|=i[y],h&=~v}return Cr=a,Io(),u}function wb(i,a){Be=null,I.H=nu,a===Zs||a===Go?(a=By(),et=3):a===zy?(a=By(),et=4):et=a===F0?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,pn=a,Ue===null&&(mt=1,lu(i,kn(a,i.current)))}function _b(){var i=I.H;return I.H=nu,i===null?nu:i}function Sb(){var i=I.A;return I.A=AA,i}function Vd(){mt=4,ti||(Ve&4194048)!==Ve&&Cn.current!==null||(La=!0),(ni&134217727)===0&&(Vi&134217727)===0||ot===null||ai(ot,Ve,Nn,!1)}function qd(i,a,u){var h=We;We|=2;var y=_b(),v=Sb();(ot!==i||Ve!==a)&&(pu=null,Pa(i,a)),a=!1;var N=mt;e:do try{if(et!==0&&Ue!==null){var z=Ue,Z=pn;switch(et){case 8:$d(),N=6;break e;case 3:case 2:case 9:case 6:Cn.current===null&&(a=!0);var re=et;if(et=0,pn=null,Ua(i,z,Z,re),u&&La){N=0;break e}break;default:re=et,et=0,pn=null,Ua(i,z,Z,re)}}NA(),N=mt;break}catch(oe){wb(i,oe)}while(!0);return a&&i.shellSuspendCounter++,xr=Bi=null,We=h,I.H=y,I.A=v,Ue===null&&(ot=null,Ve=0,Io()),N}function NA(){for(;Ue!==null;)kb(Ue)}function OA(i,a){var u=We;We|=2;var h=_b(),y=Sb();ot!==i||Ve!==a?(pu=null,hu=xt()+500,Pa(i,a)):La=Kt(i,a);e:do try{if(et!==0&&Ue!==null){a=Ue;var v=pn;t:switch(et){case 1:et=0,pn=null,Ua(i,a,v,1);break;case 2:case 9:if(Ly(v)){et=0,pn=null,Eb(a);break}a=function(){et!==2&&et!==9||ot!==i||(et=7),rr(i)},v.then(a,a);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:Ly(v)?(et=0,pn=null,Eb(a)):(et=0,pn=null,Ua(i,a,v,7));break;case 5:var N=null;switch(Ue.tag){case 26:N=Ue.memoizedState;case 5:case 27:var z=Ue;if(!N||sv(N)){et=0,pn=null;var Z=z.sibling;if(Z!==null)Ue=Z;else{var re=z.return;re!==null?(Ue=re,mu(re)):Ue=null}break t}}et=0,pn=null,Ua(i,a,v,5);break;case 6:et=0,pn=null,Ua(i,a,v,6);break;case 8:$d(),mt=6;break e;default:throw Error(r(462))}}MA();break}catch(oe){wb(i,oe)}while(!0);return xr=Bi=null,I.H=h,I.A=y,We=u,Ue!==null?0:(ot=null,Ve=0,Io(),mt)}function MA(){for(;Ue!==null&&!lt();)kb(Ue)}function kb(i){var a=K0(i.alternate,i,Cr);i.memoizedProps=i.pendingProps,a===null?mu(i):Ue=a}function Eb(i){var a=i,u=a.alternate;switch(a.tag){case 15:case 0:a=q0(u,a,a.pendingProps,a.type,void 0,Ve);break;case 11:a=q0(u,a,a.pendingProps,a.type.render,a.ref,Ve);break;case 5:sd(a);default:W0(u,a),a=Ue=Ay(a,Cr),a=K0(u,a,Cr)}i.memoizedProps=i.pendingProps,a===null?mu(i):Ue=a}function Ua(i,a,u,h){xr=Bi=null,sd(a),Ra=null,nl=0;var y=a.return;try{if(xA(i,y,a,u,Ve)){mt=1,lu(i,kn(u,i.current)),Ue=null;return}}catch(v){if(y!==null)throw Ue=y,v;mt=1,lu(i,kn(u,i.current)),Ue=null;return}a.flags&32768?(Ke||h===1?i=!0:La||(Ve&536870912)!==0?i=!1:(ti=i=!0,(h===2||h===9||h===3||h===6)&&(h=Cn.current,h!==null&&h.tag===13&&(h.flags|=16384))),Ab(a,i)):mu(a)}function mu(i){var a=i;do{if((a.flags&32768)!==0){Ab(a,ti);return}i=a.return;var u=_A(a.alternate,a,Cr);if(u!==null){Ue=u;return}if(a=a.sibling,a!==null){Ue=a;return}Ue=a=i}while(a!==null);mt===0&&(mt=5)}function Ab(i,a){do{var u=SA(i.alternate,i);if(u!==null){u.flags&=32767,Ue=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!a&&(i=i.sibling,i!==null)){Ue=i;return}Ue=i=u}while(i!==null);mt=6,Ue=null}function Tb(i,a,u,h,y,v,N,z,Z){i.cancelPendingCommit=null;do yu();while(Lt!==0);if((We&6)!==0)throw Error(r(327));if(a!==null){if(a===i.current)throw Error(r(177));if(v=a.lanes|a.childLanes,v|=zf,uf(i,u,v,N,z,Z),i===ot&&(Ue=ot=null,Ve=0),Ba=a,ii=i,Fa=u,Pd=v,Ud=y,yb=h,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,zA(Xn,function(){return Rb(),null})):(i.callbackNode=null,i.callbackPriority=0),h=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||h){h=I.T,I.T=null,y=P.p,P.p=2,N=We,We|=4;try{kA(i,a,u)}finally{We=N,P.p=y,I.T=h}}Lt=1,Cb(),Nb(),Ob()}}function Cb(){if(Lt===1){Lt=0;var i=ii,a=Ba,u=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||u){u=I.T,I.T=null;var h=P.p;P.p=2;var y=We;We|=4;try{cb(a,i);var v=rh,N=my(i.containerInfo),z=v.focusedElem,Z=v.selectionRange;if(N!==z&&z&&z.ownerDocument&&gy(z.ownerDocument.documentElement,z)){if(Z!==null&&Of(z)){var re=Z.start,oe=Z.end;if(oe===void 0&&(oe=re),"selectionStart"in z)z.selectionStart=re,z.selectionEnd=Math.min(oe,z.value.length);else{var de=z.ownerDocument||document,ie=de&&de.defaultView||window;if(ie.getSelection){var ae=ie.getSelection(),Re=z.textContent.length,Oe=Math.min(Z.start,Re),it=Z.end===void 0?Oe:Math.min(Z.end,Re);!ae.extend&&Oe>it&&(N=it,it=Oe,Oe=N);var ee=py(z,Oe),Q=py(z,it);if(ee&&Q&&(ae.rangeCount!==1||ae.anchorNode!==ee.node||ae.anchorOffset!==ee.offset||ae.focusNode!==Q.node||ae.focusOffset!==Q.offset)){var ne=de.createRange();ne.setStart(ee.node,ee.offset),ae.removeAllRanges(),Oe>it?(ae.addRange(ne),ae.extend(Q.node,Q.offset)):(ne.setEnd(Q.node,Q.offset),ae.addRange(ne))}}}}for(de=[],ae=z;ae=ae.parentNode;)ae.nodeType===1&&de.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<de.length;z++){var ue=de[z];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}Nu=!!nh,rh=nh=null}finally{We=y,P.p=h,I.T=u}}i.current=a,Lt=2}}function Nb(){if(Lt===2){Lt=0;var i=ii,a=Ba,u=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||u){u=I.T,I.T=null;var h=P.p;P.p=2;var y=We;We|=4;try{sb(i,a.alternate,a)}finally{We=y,P.p=h,I.T=u}}Lt=3}}function Ob(){if(Lt===4||Lt===3){Lt=0,ft();var i=ii,a=Ba,u=Fa,h=yb;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?Lt=5:(Lt=0,Ba=ii=null,Mb(i,i.pendingLanes));var y=i.pendingLanes;if(y===0&&(ri=null),Es(u),a=a.stateNode,he&&typeof he.onCommitFiberRoot=="function")try{he.onCommitFiberRoot(se,a,void 0,(a.current.flags&128)===128)}catch{}if(h!==null){a=I.T,y=P.p,P.p=2,I.T=null;try{for(var v=i.onRecoverableError,N=0;N<h.length;N++){var z=h[N];v(z.value,{componentStack:z.stack})}}finally{I.T=a,P.p=y}}(Fa&3)!==0&&yu(),rr(i),y=i.pendingLanes,(u&4194090)!==0&&(y&42)!==0?i===Hd?fl++:(fl=0,Hd=i):fl=0,dl(0)}}function Mb(i,a){(i.pooledCacheLanes&=a)===0&&(a=i.pooledCache,a!=null&&(i.pooledCache=null,qs(a)))}function yu(i){return Cb(),Nb(),Ob(),Rb()}function Rb(){if(Lt!==5)return!1;var i=ii,a=Pd;Pd=0;var u=Es(Fa),h=I.T,y=P.p;try{P.p=32>u?32:u,I.T=null,u=Ud,Ud=null;var v=ii,N=Fa;if(Lt=0,Ba=ii=null,Fa=0,(We&6)!==0)throw Error(r(331));var z=We;if(We|=4,gb(v.current),db(v,v.current,N,u),We=z,dl(0,!1),he&&typeof he.onPostCommitFiberRoot=="function")try{he.onPostCommitFiberRoot(se,v)}catch{}return!0}finally{P.p=y,I.T=h,Mb(i,a)}}function Db(i,a,u){a=kn(u,a),a=xd(i.stateNode,a,2),i=Yr(i,a,2),i!==null&&(Ci(i,2),rr(i))}function at(i,a,u){if(i.tag===3)Db(i,i,u);else for(;a!==null;){if(a.tag===3){Db(a,i,u);break}else if(a.tag===1){var h=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(ri===null||!ri.has(h))){i=kn(u,i),u=I0(2),h=Yr(a,u,2),h!==null&&(B0(u,h,a,i),Ci(h,2),rr(h));break}}a=a.return}}function Gd(i,a,u){var h=i.pingCache;if(h===null){h=i.pingCache=new TA;var y=new Set;h.set(a,y)}else y=h.get(a),y===void 0&&(y=new Set,h.set(a,y));y.has(u)||(Ld=!0,y.add(u),i=RA.bind(null,i,a,u),a.then(i,i))}function RA(i,a,u){var h=i.pingCache;h!==null&&h.delete(a),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,ot===i&&(Ve&u)===u&&(mt===4||mt===3&&(Ve&62914560)===Ve&&300>xt()-Fd?(We&2)===0&&Pa(i,0):Id|=u,Ia===Ve&&(Ia=0)),rr(i)}function jb(i,a){a===0&&(a=bo()),i=_a(i,a),i!==null&&(Ci(i,a),rr(i))}function DA(i){var a=i.memoizedState,u=0;a!==null&&(u=a.retryLane),jb(i,u)}function jA(i,a){var u=0;switch(i.tag){case 13:var h=i.stateNode,y=i.memoizedState;y!==null&&(u=y.retryLane);break;case 19:h=i.stateNode;break;case 22:h=i.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(a),jb(i,u)}function zA(i,a){return je(i,a)}var bu=null,Ha=null,Zd=!1,vu=!1,Yd=!1,qi=0;function rr(i){i!==Ha&&i.next===null&&(Ha===null?bu=Ha=i:Ha=Ha.next=i),vu=!0,Zd||(Zd=!0,IA())}function dl(i,a){if(!Yd&&vu){Yd=!0;do for(var u=!1,h=bu;h!==null;){if(i!==0){var y=h.pendingLanes;if(y===0)var v=0;else{var N=h.suspendedLanes,z=h.pingedLanes;v=(1<<31-Te(42|i)+1)-1,v&=y&~(N&~z),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(u=!0,Bb(h,v))}else v=Ve,v=wt(h,h===ot?v:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(v&3)===0||Kt(h,v)||(u=!0,Bb(h,v));h=h.next}while(u);Yd=!1}}function LA(){zb()}function zb(){vu=Zd=!1;var i=0;qi!==0&&(qA()&&(i=qi),qi=0);for(var a=xt(),u=null,h=bu;h!==null;){var y=h.next,v=Lb(h,a);v===0?(h.next=null,u===null?bu=y:u.next=y,y===null&&(Ha=u)):(u=h,(i!==0||(v&3)!==0)&&(vu=!0)),h=y}dl(i)}function Lb(i,a){for(var u=i.suspendedLanes,h=i.pingedLanes,y=i.expirationTimes,v=i.pendingLanes&-62914561;0<v;){var N=31-Te(v),z=1<<N,Z=y[N];Z===-1?((z&u)===0||(z&h)!==0)&&(y[N]=un(z,a)):Z<=a&&(i.expiredLanes|=z),v&=~z}if(a=ot,u=Ve,u=wt(i,i===a?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h=i.callbackNode,u===0||i===a&&(et===2||et===9)||i.cancelPendingCommit!==null)return h!==null&&h!==null&&ze(h),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||Kt(i,u)){if(a=u&-u,a===i.callbackPriority)return a;switch(h!==null&&ze(h),Es(u)){case 2:case 8:u=Dn;break;case 32:u=Xn;break;case 268435456:u=Qn;break;default:u=Xn}return h=Ib.bind(null,i),u=je(u,h),i.callbackPriority=a,i.callbackNode=u,a}return h!==null&&h!==null&&ze(h),i.callbackPriority=2,i.callbackNode=null,2}function Ib(i,a){if(Lt!==0&&Lt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(yu()&&i.callbackNode!==u)return null;var h=Ve;return h=wt(i,i===ot?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h===0?null:(vb(i,h,a),Lb(i,xt()),i.callbackNode!=null&&i.callbackNode===u?Ib.bind(null,i):null)}function Bb(i,a){if(yu())return null;vb(i,a,!0)}function IA(){ZA(function(){(We&6)!==0?je(fr,LA):zb()})}function Xd(){return qi===0&&(qi=yo()),qi}function Fb(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Oo(""+i)}function Pb(i,a){var u=a.ownerDocument.createElement("input");return u.name=a.name,u.value=a.value,i.id&&u.setAttribute("form",i.id),a.parentNode.insertBefore(u,a),i=new FormData(i),u.parentNode.removeChild(u),i}function BA(i,a,u,h,y){if(a==="submit"&&u&&u.stateNode===y){var v=Fb((y[Ut]||null).action),N=h.submitter;N&&(a=(a=N[Ut]||null)?Fb(a.formAction):N.getAttribute("formAction"),a!==null&&(v=a,N=null));var z=new jo("action","action",null,h,y);i.push({event:z,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(qi!==0){var Z=N?Pb(y,N):new FormData(y);gd(u,{pending:!0,data:Z,method:y.method,action:v},null,Z)}}else typeof v=="function"&&(z.preventDefault(),Z=N?Pb(y,N):new FormData(y),gd(u,{pending:!0,data:Z,method:y.method,action:v},v,Z))},currentTarget:y}]})}}for(var Qd=0;Qd<jf.length;Qd++){var Kd=jf[Qd],FA=Kd.toLowerCase(),PA=Kd[0].toUpperCase()+Kd.slice(1);Ln(FA,"on"+PA)}Ln(vy,"onAnimationEnd"),Ln(xy,"onAnimationIteration"),Ln(wy,"onAnimationStart"),Ln("dblclick","onDoubleClick"),Ln("focusin","onFocus"),Ln("focusout","onBlur"),Ln(rA,"onTransitionRun"),Ln(iA,"onTransitionStart"),Ln(aA,"onTransitionCancel"),Ln(_y,"onTransitionEnd"),Ur("onMouseEnter",["mouseout","mouseover"]),Ur("onMouseLeave",["mouseout","mouseover"]),Ur("onPointerEnter",["pointerout","pointerover"]),Ur("onPointerLeave",["pointerout","pointerover"]),gr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),gr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),gr("onBeforeInput",["compositionend","keypress","textInput","paste"]),gr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),gr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),gr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),UA=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(hl));function Ub(i,a){a=(a&4)!==0;for(var u=0;u<i.length;u++){var h=i[u],y=h.event;h=h.listeners;e:{var v=void 0;if(a)for(var N=h.length-1;0<=N;N--){var z=h[N],Z=z.instance,re=z.currentTarget;if(z=z.listener,Z!==v&&y.isPropagationStopped())break e;v=z,y.currentTarget=re;try{v(y)}catch(oe){su(oe)}y.currentTarget=null,v=Z}else for(N=0;N<h.length;N++){if(z=h[N],Z=z.instance,re=z.currentTarget,z=z.listener,Z!==v&&y.isPropagationStopped())break e;v=z,y.currentTarget=re;try{v(y)}catch(oe){su(oe)}y.currentTarget=null,v=Z}}}}function He(i,a){var u=a[As];u===void 0&&(u=a[As]=new Set);var h=i+"__bubble";u.has(h)||(Hb(a,i,2,!1),u.add(h))}function Jd(i,a,u){var h=0;a&&(h|=4),Hb(u,i,h,a)}var xu="_reactListening"+Math.random().toString(36).slice(2);function Wd(i){if(!i[xu]){i[xu]=!0,_o.forEach(function(u){u!=="selectionchange"&&(UA.has(u)||Jd(u,!1,i),Jd(u,!0,i))});var a=i.nodeType===9?i:i.ownerDocument;a===null||a[xu]||(a[xu]=!0,Jd("selectionchange",!1,a))}}function Hb(i,a,u,h){switch(dv(a)){case 2:var y=pT;break;case 8:y=gT;break;default:y=hh}u=y.bind(null,a,u,i),y=void 0,!wf||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(y=!0),h?y!==void 0?i.addEventListener(a,u,{capture:!0,passive:y}):i.addEventListener(a,u,!0):y!==void 0?i.addEventListener(a,u,{passive:y}):i.addEventListener(a,u,!1)}function eh(i,a,u,h,y){var v=h;if((a&1)===0&&(a&2)===0&&h!==null)e:for(;;){if(h===null)return;var N=h.tag;if(N===3||N===4){var z=h.stateNode.containerInfo;if(z===y)break;if(N===4)for(N=h.return;N!==null;){var Z=N.tag;if((Z===3||Z===4)&&N.stateNode.containerInfo===y)return;N=N.return}for(;z!==null;){if(N=hr(z),N===null)return;if(Z=N.tag,Z===5||Z===6||Z===26||Z===27){h=v=N;continue e}z=z.parentNode}}h=h.return}Xm(function(){var re=v,oe=vf(u),de=[];e:{var ie=Sy.get(i);if(ie!==void 0){var ae=jo,Re=i;switch(i){case"keypress":if(Ro(u)===0)break e;case"keydown":case"keyup":ae=z2;break;case"focusin":Re="focus",ae=Ef;break;case"focusout":Re="blur",ae=Ef;break;case"beforeblur":case"afterblur":ae=Ef;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ae=Jm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=S2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=B2;break;case vy:case xy:case wy:ae=A2;break;case _y:ae=P2;break;case"scroll":case"scrollend":ae=w2;break;case"wheel":ae=H2;break;case"copy":case"cut":case"paste":ae=C2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=ey;break;case"toggle":case"beforetoggle":ae=V2}var Oe=(a&4)!==0,it=!Oe&&(i==="scroll"||i==="scrollend"),ee=Oe?ie!==null?ie+"Capture":null:ie;Oe=[];for(var Q=re,ne;Q!==null;){var ue=Q;if(ne=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||ne===null||ee===null||(ue=Rs(Q,ee),ue!=null&&Oe.push(pl(Q,ue,ne))),it)break;Q=Q.return}0<Oe.length&&(ie=new ae(ie,Re,null,u,oe),de.push({event:ie,listeners:Oe}))}}if((a&7)===0){e:{if(ie=i==="mouseover"||i==="pointerover",ae=i==="mouseout"||i==="pointerout",ie&&u!==bf&&(Re=u.relatedTarget||u.fromElement)&&(hr(Re)||Re[Br]))break e;if((ae||ie)&&(ie=oe.window===oe?oe:(ie=oe.ownerDocument)?ie.defaultView||ie.parentWindow:window,ae?(Re=u.relatedTarget||u.toElement,ae=re,Re=Re?hr(Re):null,Re!==null&&(it=l(Re),Oe=Re.tag,Re!==it||Oe!==5&&Oe!==27&&Oe!==6)&&(Re=null)):(ae=null,Re=re),ae!==Re)){if(Oe=Jm,ue="onMouseLeave",ee="onMouseEnter",Q="mouse",(i==="pointerout"||i==="pointerover")&&(Oe=ey,ue="onPointerLeave",ee="onPointerEnter",Q="pointer"),it=ae==null?ie:Fr(ae),ne=Re==null?ie:Fr(Re),ie=new Oe(ue,Q+"leave",ae,u,oe),ie.target=it,ie.relatedTarget=ne,ue=null,hr(oe)===re&&(Oe=new Oe(ee,Q+"enter",Re,u,oe),Oe.target=ne,Oe.relatedTarget=it,ue=Oe),it=ue,ae&&Re)t:{for(Oe=ae,ee=Re,Q=0,ne=Oe;ne;ne=$a(ne))Q++;for(ne=0,ue=ee;ue;ue=$a(ue))ne++;for(;0<Q-ne;)Oe=$a(Oe),Q--;for(;0<ne-Q;)ee=$a(ee),ne--;for(;Q--;){if(Oe===ee||ee!==null&&Oe===ee.alternate)break t;Oe=$a(Oe),ee=$a(ee)}Oe=null}else Oe=null;ae!==null&&$b(de,ie,ae,Oe,!1),Re!==null&&it!==null&&$b(de,it,Re,Oe,!0)}}e:{if(ie=re?Fr(re):window,ae=ie.nodeName&&ie.nodeName.toLowerCase(),ae==="select"||ae==="input"&&ie.type==="file")var xe=oy;else if(sy(ie))if(uy)xe=eA;else{xe=J2;var Fe=K2}else ae=ie.nodeName,!ae||ae.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?re&&yf(re.elementType)&&(xe=oy):xe=W2;if(xe&&(xe=xe(i,re))){ly(de,xe,u,oe);break e}Fe&&Fe(i,ie,re),i==="focusout"&&re&&ie.type==="number"&&re.memoizedProps.value!=null&&mf(ie,"number",ie.value)}switch(Fe=re?Fr(re):window,i){case"focusin":(sy(Fe)||Fe.contentEditable==="true")&&(va=Fe,Mf=re,Ps=null);break;case"focusout":Ps=Mf=va=null;break;case"mousedown":Rf=!0;break;case"contextmenu":case"mouseup":case"dragend":Rf=!1,yy(de,u,oe);break;case"selectionchange":if(nA)break;case"keydown":case"keyup":yy(de,u,oe)}var ke;if(Tf)e:{switch(i){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else ba?iy(i,u)&&(Me="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(Me="onCompositionStart");Me&&(ty&&u.locale!=="ko"&&(ba||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&ba&&(ke=Qm()):(Vr=oe,_f="value"in Vr?Vr.value:Vr.textContent,ba=!0)),Fe=wu(re,Me),0<Fe.length&&(Me=new Wm(Me,i,null,u,oe),de.push({event:Me,listeners:Fe}),ke?Me.data=ke:(ke=ay(u),ke!==null&&(Me.data=ke)))),(ke=G2?Z2(i,u):Y2(i,u))&&(Me=wu(re,"onBeforeInput"),0<Me.length&&(Fe=new Wm("onBeforeInput","beforeinput",null,u,oe),de.push({event:Fe,listeners:Me}),Fe.data=ke)),BA(de,i,re,u,oe)}Ub(de,a)})}function pl(i,a,u){return{instance:i,listener:a,currentTarget:u}}function wu(i,a){for(var u=a+"Capture",h=[];i!==null;){var y=i,v=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||v===null||(y=Rs(i,u),y!=null&&h.unshift(pl(i,y,v)),y=Rs(i,a),y!=null&&h.push(pl(i,y,v))),i.tag===3)return h;i=i.return}return[]}function $a(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function $b(i,a,u,h,y){for(var v=a._reactName,N=[];u!==null&&u!==h;){var z=u,Z=z.alternate,re=z.stateNode;if(z=z.tag,Z!==null&&Z===h)break;z!==5&&z!==26&&z!==27||re===null||(Z=re,y?(re=Rs(u,v),re!=null&&N.unshift(pl(u,re,Z))):y||(re=Rs(u,v),re!=null&&N.push(pl(u,re,Z)))),u=u.return}N.length!==0&&i.push({event:a,listeners:N})}var HA=/\r\n?/g,$A=/\u0000|\uFFFD/g;function Vb(i){return(typeof i=="string"?i:""+i).replace(HA,`
|
|
49
|
-
`).replace($A,"")}function qb(i,a){return a=Vb(a),Vb(i)===a}function _u(){}function rt(i,a,u,h,y,v){switch(u){case"children":typeof h=="string"?a==="body"||a==="textarea"&&h===""||ga(i,h):(typeof h=="number"||typeof h=="bigint")&&a!=="body"&&ga(i,""+h);break;case"className":ca(i,"class",h);break;case"tabIndex":ca(i,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":ca(i,u,h);break;case"style":Zm(i,h,v);break;case"data":if(a!=="object"){ca(i,"data",h);break}case"src":case"href":if(h===""&&(a!=="a"||u!=="href")){i.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(u);break}h=Oo(""+h),i.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){i.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(u==="formAction"?(a!=="input"&&rt(i,a,"name",y.name,y,null),rt(i,a,"formEncType",y.formEncType,y,null),rt(i,a,"formMethod",y.formMethod,y,null),rt(i,a,"formTarget",y.formTarget,y,null)):(rt(i,a,"encType",y.encType,y,null),rt(i,a,"method",y.method,y,null),rt(i,a,"target",y.target,y,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(u);break}h=Oo(""+h),i.setAttribute(u,h);break;case"onClick":h!=null&&(i.onclick=_u);break;case"onScroll":h!=null&&He("scroll",i);break;case"onScrollEnd":h!=null&&He("scrollend",i);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(y.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"multiple":i.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":i.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){i.removeAttribute("xlink:href");break}u=Oo(""+h),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(u,""+h):i.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":h===!0?i.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(u,h):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?i.setAttribute(u,h):i.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?i.removeAttribute(u):i.setAttribute(u,h);break;case"popover":He("beforetoggle",i),He("toggle",i),ua(i,"popover",h);break;case"xlinkActuate":zn(i,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":zn(i,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":zn(i,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":zn(i,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":zn(i,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":zn(i,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":zn(i,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":zn(i,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":zn(i,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":ua(i,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=v2.get(u)||u,ua(i,u,h))}}function th(i,a,u,h,y,v){switch(u){case"style":Zm(i,h,v);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(y.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"children":typeof h=="string"?ga(i,h):(typeof h=="number"||typeof h=="bigint")&&ga(i,""+h);break;case"onScroll":h!=null&&He("scroll",i);break;case"onScrollEnd":h!=null&&He("scrollend",i);break;case"onClick":h!=null&&(i.onclick=_u);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!So.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),a=u.slice(2,y?u.length-7:void 0),v=i[Ut]||null,v=v!=null?v[u]:null,typeof v=="function"&&i.removeEventListener(a,v,y),typeof h=="function")){typeof v!="function"&&v!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(a,h,y);break e}u in i?i[u]=h:h===!0?i.setAttribute(u,""):ua(i,u,h)}}}function It(i,a,u){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",i),He("load",i);var h=!1,y=!1,v;for(v in u)if(u.hasOwnProperty(v)){var N=u[v];if(N!=null)switch(v){case"src":h=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:rt(i,a,v,N,u,null)}}y&&rt(i,a,"srcSet",u.srcSet,u,null),h&&rt(i,a,"src",u.src,u,null);return;case"input":He("invalid",i);var z=v=N=y=null,Z=null,re=null;for(h in u)if(u.hasOwnProperty(h)){var oe=u[h];if(oe!=null)switch(h){case"name":y=oe;break;case"type":N=oe;break;case"checked":Z=oe;break;case"defaultChecked":re=oe;break;case"value":v=oe;break;case"defaultValue":z=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,a));break;default:rt(i,a,h,oe,u,null)}}$m(i,v,z,Z,re,N,y,!1),da(i);return;case"select":He("invalid",i),h=N=v=null;for(y in u)if(u.hasOwnProperty(y)&&(z=u[y],z!=null))switch(y){case"value":v=z;break;case"defaultValue":N=z;break;case"multiple":h=z;default:rt(i,a,y,z,u,null)}a=v,u=N,i.multiple=!!h,a!=null?pa(i,!!h,a,!1):u!=null&&pa(i,!!h,u,!0);return;case"textarea":He("invalid",i),v=y=h=null;for(N in u)if(u.hasOwnProperty(N)&&(z=u[N],z!=null))switch(N){case"value":h=z;break;case"defaultValue":y=z;break;case"children":v=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(r(91));break;default:rt(i,a,N,z,u,null)}qm(i,h,y,v),da(i);return;case"option":for(Z in u)if(u.hasOwnProperty(Z)&&(h=u[Z],h!=null))switch(Z){case"selected":i.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:rt(i,a,Z,h,u,null)}return;case"dialog":He("beforetoggle",i),He("toggle",i),He("cancel",i),He("close",i);break;case"iframe":case"object":He("load",i);break;case"video":case"audio":for(h=0;h<hl.length;h++)He(hl[h],i);break;case"image":He("error",i),He("load",i);break;case"details":He("toggle",i);break;case"embed":case"source":case"link":He("error",i),He("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(re in u)if(u.hasOwnProperty(re)&&(h=u[re],h!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:rt(i,a,re,h,u,null)}return;default:if(yf(a)){for(oe in u)u.hasOwnProperty(oe)&&(h=u[oe],h!==void 0&&th(i,a,oe,h,u,void 0));return}}for(z in u)u.hasOwnProperty(z)&&(h=u[z],h!=null&&rt(i,a,z,h,u,null))}function VA(i,a,u,h){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,v=null,N=null,z=null,Z=null,re=null,oe=null;for(ae in u){var de=u[ae];if(u.hasOwnProperty(ae)&&de!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":Z=de;default:h.hasOwnProperty(ae)||rt(i,a,ae,null,h,de)}}for(var ie in h){var ae=h[ie];if(de=u[ie],h.hasOwnProperty(ie)&&(ae!=null||de!=null))switch(ie){case"type":v=ae;break;case"name":y=ae;break;case"checked":re=ae;break;case"defaultChecked":oe=ae;break;case"value":N=ae;break;case"defaultValue":z=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,a));break;default:ae!==de&&rt(i,a,ie,ae,h,de)}}ha(i,N,z,Z,re,oe,v,y);return;case"select":ae=N=z=ie=null;for(v in u)if(Z=u[v],u.hasOwnProperty(v)&&Z!=null)switch(v){case"value":break;case"multiple":ae=Z;default:h.hasOwnProperty(v)||rt(i,a,v,null,h,Z)}for(y in h)if(v=h[y],Z=u[y],h.hasOwnProperty(y)&&(v!=null||Z!=null))switch(y){case"value":ie=v;break;case"defaultValue":z=v;break;case"multiple":N=v;default:v!==Z&&rt(i,a,y,v,h,Z)}a=z,u=N,h=ae,ie!=null?pa(i,!!u,ie,!1):!!h!=!!u&&(a!=null?pa(i,!!u,a,!0):pa(i,!!u,u?[]:"",!1));return;case"textarea":ae=ie=null;for(z in u)if(y=u[z],u.hasOwnProperty(z)&&y!=null&&!h.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:rt(i,a,z,null,h,y)}for(N in h)if(y=h[N],v=u[N],h.hasOwnProperty(N)&&(y!=null||v!=null))switch(N){case"value":ie=y;break;case"defaultValue":ae=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==v&&rt(i,a,N,y,h,v)}Vm(i,ie,ae);return;case"option":for(var Re in u)if(ie=u[Re],u.hasOwnProperty(Re)&&ie!=null&&!h.hasOwnProperty(Re))switch(Re){case"selected":i.selected=!1;break;default:rt(i,a,Re,null,h,ie)}for(Z in h)if(ie=h[Z],ae=u[Z],h.hasOwnProperty(Z)&&ie!==ae&&(ie!=null||ae!=null))switch(Z){case"selected":i.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:rt(i,a,Z,ie,h,ae)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Oe in u)ie=u[Oe],u.hasOwnProperty(Oe)&&ie!=null&&!h.hasOwnProperty(Oe)&&rt(i,a,Oe,null,h,ie);for(re in h)if(ie=h[re],ae=u[re],h.hasOwnProperty(re)&&ie!==ae&&(ie!=null||ae!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,a));break;default:rt(i,a,re,ie,h,ae)}return;default:if(yf(a)){for(var it in u)ie=u[it],u.hasOwnProperty(it)&&ie!==void 0&&!h.hasOwnProperty(it)&&th(i,a,it,void 0,h,ie);for(oe in h)ie=h[oe],ae=u[oe],!h.hasOwnProperty(oe)||ie===ae||ie===void 0&&ae===void 0||th(i,a,oe,ie,h,ae);return}}for(var ee in u)ie=u[ee],u.hasOwnProperty(ee)&&ie!=null&&!h.hasOwnProperty(ee)&&rt(i,a,ee,null,h,ie);for(de in h)ie=h[de],ae=u[de],!h.hasOwnProperty(de)||ie===ae||ie==null&&ae==null||rt(i,a,de,ie,h,ae)}var nh=null,rh=null;function Su(i){return i.nodeType===9?i:i.ownerDocument}function Gb(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Zb(i,a){if(i===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&a==="foreignObject"?0:i}function ih(i,a){return i==="textarea"||i==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var ah=null;function qA(){var i=window.event;return i&&i.type==="popstate"?i===ah?!1:(ah=i,!0):(ah=null,!1)}var Yb=typeof setTimeout=="function"?setTimeout:void 0,GA=typeof clearTimeout=="function"?clearTimeout:void 0,Xb=typeof Promise=="function"?Promise:void 0,ZA=typeof queueMicrotask=="function"?queueMicrotask:typeof Xb<"u"?function(i){return Xb.resolve(null).then(i).catch(YA)}:Yb;function YA(i){setTimeout(function(){throw i})}function si(i){return i==="head"}function Qb(i,a){var u=a,h=0,y=0;do{var v=u.nextSibling;if(i.removeChild(u),v&&v.nodeType===8)if(u=v.data,u==="/$"){if(0<h&&8>h){u=h;var N=i.ownerDocument;if(u&1&&gl(N.documentElement),u&2&&gl(N.body),u&4)for(u=N.head,gl(u),N=u.firstChild;N;){var z=N.nextSibling,Z=N.nodeName;N[Ni]||Z==="SCRIPT"||Z==="STYLE"||Z==="LINK"&&N.rel.toLowerCase()==="stylesheet"||u.removeChild(N),N=z}}if(y===0){i.removeChild(v),Sl(a);return}y--}else u==="$"||u==="$?"||u==="$!"?y++:h=u.charCodeAt(0)-48;else h=0;u=v}while(u);Sl(a)}function sh(i){var a=i.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var u=a;switch(a=a.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":sh(u),Ts(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function XA(i,a,u,h){for(;i.nodeType===1;){var y=u;if(i.nodeName.toLowerCase()!==a.toLowerCase()){if(!h&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(h){if(!i[Ni])switch(a){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(v=i.getAttribute("rel"),v==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(v!==y.rel||i.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||i.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||i.getAttribute("title")!==(y.title==null?null:y.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(v=i.getAttribute("src"),(v!==(y.src==null?null:y.src)||i.getAttribute("type")!==(y.type==null?null:y.type)||i.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&v&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(a==="input"&&i.type==="hidden"){var v=y.name==null?null:""+y.name;if(y.type==="hidden"&&i.getAttribute("name")===v)return i}else return i;if(i=Bn(i.nextSibling),i===null)break}return null}function QA(i,a,u){if(a==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=Bn(i.nextSibling),i===null))return null;return i}function lh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState==="complete"}function KA(i,a){var u=i.ownerDocument;if(i.data!=="$?"||u.readyState==="complete")a();else{var h=function(){a(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),i._reactRetry=h}}function Bn(i){for(;i!=null;i=i.nextSibling){var a=i.nodeType;if(a===1||a===3)break;if(a===8){if(a=i.data,a==="$"||a==="$!"||a==="$?"||a==="F!"||a==="F")break;if(a==="/$")return null}}return i}var oh=null;function Kb(i){i=i.previousSibling;for(var a=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"){if(a===0)return i;a--}else u==="/$"&&a++}i=i.previousSibling}return null}function Jb(i,a,u){switch(a=Su(u),i){case"html":if(i=a.documentElement,!i)throw Error(r(452));return i;case"head":if(i=a.head,!i)throw Error(r(453));return i;case"body":if(i=a.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function gl(i){for(var a=i.attributes;a.length;)i.removeAttributeNode(a[0]);Ts(i)}var On=new Map,Wb=new Set;function ku(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Nr=P.d;P.d={f:JA,r:WA,D:eT,C:tT,L:nT,m:rT,X:aT,S:iT,M:sT};function JA(){var i=Nr.f(),a=gu();return i||a}function WA(i){var a=pr(i);a!==null&&a.tag===5&&a.type==="form"?v0(a):Nr.r(i)}var Va=typeof document>"u"?null:document;function ev(i,a,u){var h=Va;if(h&&typeof a=="string"&&a){var y=Wt(a);y='link[rel="'+i+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),Wb.has(y)||(Wb.add(y),i={rel:i,crossOrigin:u,href:a},h.querySelector(y)===null&&(a=h.createElement("link"),It(a,"link",i),_t(a),h.head.appendChild(a)))}}function eT(i){Nr.D(i),ev("dns-prefetch",i,null)}function tT(i,a){Nr.C(i,a),ev("preconnect",i,a)}function nT(i,a,u){Nr.L(i,a,u);var h=Va;if(h&&i&&a){var y='link[rel="preload"][as="'+Wt(a)+'"]';a==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+Wt(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+Wt(u.imageSizes)+'"]')):y+='[href="'+Wt(i)+'"]';var v=y;switch(a){case"style":v=qa(i);break;case"script":v=Ga(i)}On.has(v)||(i=p({rel:"preload",href:a==="image"&&u&&u.imageSrcSet?void 0:i,as:a},u),On.set(v,i),h.querySelector(y)!==null||a==="style"&&h.querySelector(ml(v))||a==="script"&&h.querySelector(yl(v))||(a=h.createElement("link"),It(a,"link",i),_t(a),h.head.appendChild(a)))}}function rT(i,a){Nr.m(i,a);var u=Va;if(u&&i){var h=a&&typeof a.as=="string"?a.as:"script",y='link[rel="modulepreload"][as="'+Wt(h)+'"][href="'+Wt(i)+'"]',v=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Ga(i)}if(!On.has(v)&&(i=p({rel:"modulepreload",href:i},a),On.set(v,i),u.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(yl(v)))return}h=u.createElement("link"),It(h,"link",i),_t(h),u.head.appendChild(h)}}}function iT(i,a,u){Nr.S(i,a,u);var h=Va;if(h&&i){var y=Pr(h).hoistableStyles,v=qa(i);a=a||"default";var N=y.get(v);if(!N){var z={loading:0,preload:null};if(N=h.querySelector(ml(v)))z.loading=5;else{i=p({rel:"stylesheet",href:i,"data-precedence":a},u),(u=On.get(v))&&uh(i,u);var Z=N=h.createElement("link");_t(Z),It(Z,"link",i),Z._p=new Promise(function(re,oe){Z.onload=re,Z.onerror=oe}),Z.addEventListener("load",function(){z.loading|=1}),Z.addEventListener("error",function(){z.loading|=2}),z.loading|=4,Eu(N,a,h)}N={type:"stylesheet",instance:N,count:1,state:z},y.set(v,N)}}}function aT(i,a){Nr.X(i,a);var u=Va;if(u&&i){var h=Pr(u).hoistableScripts,y=Ga(i),v=h.get(y);v||(v=u.querySelector(yl(y)),v||(i=p({src:i,async:!0},a),(a=On.get(y))&&ch(i,a),v=u.createElement("script"),_t(v),It(v,"link",i),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},h.set(y,v))}}function sT(i,a){Nr.M(i,a);var u=Va;if(u&&i){var h=Pr(u).hoistableScripts,y=Ga(i),v=h.get(y);v||(v=u.querySelector(yl(y)),v||(i=p({src:i,async:!0,type:"module"},a),(a=On.get(y))&&ch(i,a),v=u.createElement("script"),_t(v),It(v,"link",i),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},h.set(y,v))}}function tv(i,a,u,h){var y=(y=J.current)?ku(y):null;if(!y)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(a=qa(u.href),u=Pr(y).hoistableStyles,h=u.get(a),h||(h={type:"style",instance:null,count:0,state:null},u.set(a,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=qa(u.href);var v=Pr(y).hoistableStyles,N=v.get(i);if(N||(y=y.ownerDocument||y,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(i,N),(v=y.querySelector(ml(i)))&&!v._p&&(N.instance=v,N.state.loading=5),On.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},On.set(i,u),v||lT(y,i,u,N.state))),a&&h===null)throw Error(r(528,""));return N}if(a&&h!==null)throw Error(r(529,""));return null;case"script":return a=u.async,u=u.src,typeof u=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Ga(u),u=Pr(y).hoistableScripts,h=u.get(a),h||(h={type:"script",instance:null,count:0,state:null},u.set(a,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function qa(i){return'href="'+Wt(i)+'"'}function ml(i){return'link[rel="stylesheet"]['+i+"]"}function nv(i){return p({},i,{"data-precedence":i.precedence,precedence:null})}function lT(i,a,u,h){i.querySelector('link[rel="preload"][as="style"]['+a+"]")?h.loading=1:(a=i.createElement("link"),h.preload=a,a.addEventListener("load",function(){return h.loading|=1}),a.addEventListener("error",function(){return h.loading|=2}),It(a,"link",u),_t(a),i.head.appendChild(a))}function Ga(i){return'[src="'+Wt(i)+'"]'}function yl(i){return"script[async]"+i}function rv(i,a,u){if(a.count++,a.instance===null)switch(a.type){case"style":var h=i.querySelector('style[data-href~="'+Wt(u.href)+'"]');if(h)return a.instance=h,_t(h),h;var y=p({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(i.ownerDocument||i).createElement("style"),_t(h),It(h,"style",y),Eu(h,u.precedence,i),a.instance=h;case"stylesheet":y=qa(u.href);var v=i.querySelector(ml(y));if(v)return a.state.loading|=4,a.instance=v,_t(v),v;h=nv(u),(y=On.get(y))&&uh(h,y),v=(i.ownerDocument||i).createElement("link"),_t(v);var N=v;return N._p=new Promise(function(z,Z){N.onload=z,N.onerror=Z}),It(v,"link",h),a.state.loading|=4,Eu(v,u.precedence,i),a.instance=v;case"script":return v=Ga(u.src),(y=i.querySelector(yl(v)))?(a.instance=y,_t(y),y):(h=u,(y=On.get(v))&&(h=p({},u),ch(h,y)),i=i.ownerDocument||i,y=i.createElement("script"),_t(y),It(y,"link",h),i.head.appendChild(y),a.instance=y);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(h=a.instance,a.state.loading|=4,Eu(h,u.precedence,i));return a.instance}function Eu(i,a,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,v=y,N=0;N<h.length;N++){var z=h[N];if(z.dataset.precedence===a)v=z;else if(v!==y)break}v?v.parentNode.insertBefore(i,v.nextSibling):(a=u.nodeType===9?u.head:u,a.insertBefore(i,a.firstChild))}function uh(i,a){i.crossOrigin==null&&(i.crossOrigin=a.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=a.referrerPolicy),i.title==null&&(i.title=a.title)}function ch(i,a){i.crossOrigin==null&&(i.crossOrigin=a.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=a.referrerPolicy),i.integrity==null&&(i.integrity=a.integrity)}var Au=null;function iv(i,a,u){if(Au===null){var h=new Map,y=Au=new Map;y.set(u,h)}else y=Au,h=y.get(u),h||(h=new Map,y.set(u,h));if(h.has(i))return h;for(h.set(i,null),u=u.getElementsByTagName(i),y=0;y<u.length;y++){var v=u[y];if(!(v[Ni]||v[Mt]||i==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var N=v.getAttribute(a)||"";N=i+N;var z=h.get(N);z?z.push(v):h.set(N,[v])}}return h}function av(i,a,u){i=i.ownerDocument||i,i.head.insertBefore(u,a==="title"?i.querySelector("head > title"):null)}function oT(i,a,u){if(u===1||a.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return i=a.disabled,typeof a.precedence=="string"&&i==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function sv(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}var bl=null;function uT(){}function cT(i,a,u){if(bl===null)throw Error(r(475));var h=bl;if(a.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var y=qa(u.href),v=i.querySelector(ml(y));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(h.count++,h=Tu.bind(h),i.then(h,h)),a.state.loading|=4,a.instance=v,_t(v);return}v=i.ownerDocument||i,u=nv(u),(y=On.get(y))&&uh(u,y),v=v.createElement("link"),_t(v);var N=v;N._p=new Promise(function(z,Z){N.onload=z,N.onerror=Z}),It(v,"link",u),a.instance=v}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(a,i),(i=a.state.preload)&&(a.state.loading&3)===0&&(h.count++,a=Tu.bind(h),i.addEventListener("load",a),i.addEventListener("error",a))}}function fT(){if(bl===null)throw Error(r(475));var i=bl;return i.stylesheets&&i.count===0&&fh(i,i.stylesheets),0<i.count?function(a){var u=setTimeout(function(){if(i.stylesheets&&fh(i,i.stylesheets),i.unsuspend){var h=i.unsuspend;i.unsuspend=null,h()}},6e4);return i.unsuspend=a,function(){i.unsuspend=null,clearTimeout(u)}}:null}function Tu(){if(this.count--,this.count===0){if(this.stylesheets)fh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Cu=null;function fh(i,a){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Cu=new Map,a.forEach(dT,i),Cu=null,Tu.call(i))}function dT(i,a){if(!(a.state.loading&4)){var u=Cu.get(i);if(u)var h=u.get(null);else{u=new Map,Cu.set(i,u);for(var y=i.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<y.length;v++){var N=y[v];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(u.set(N.dataset.precedence,N),h=N)}h&&u.set(null,h)}y=a.instance,N=y.getAttribute("data-precedence"),v=u.get(N)||h,v===h&&u.set(null,y),u.set(N,y),this.count++,h=Tu.bind(this),y.addEventListener("load",h),y.addEventListener("error",h),v?v.parentNode.insertBefore(y,v.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(y,i.firstChild)),a.state.loading|=4}}var vl={$$typeof:S,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function hT(i,a,u,h,y,v,N,z){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=_s(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_s(0),this.hiddenUpdates=_s(null),this.identifierPrefix=h,this.onUncaughtError=y,this.onCaughtError=v,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function lv(i,a,u,h,y,v,N,z,Z,re,oe,de){return i=new hT(i,a,u,N,z,Z,re,de),a=1,v===!0&&(a|=24),v=fn(3,null,null,a),i.current=v,v.stateNode=i,a=Gf(),a.refCount++,i.pooledCache=a,a.refCount++,v.memoizedState={element:h,isDehydrated:u,cache:a},Qf(v),i}function ov(i){return i?(i=Sa,i):Sa}function uv(i,a,u,h,y,v){y=ov(y),h.context===null?h.context=y:h.pendingContext=y,h=Zr(a),h.payload={element:u},v=v===void 0?null:v,v!==null&&(h.callback=v),u=Yr(i,h,a),u!==null&&(mn(u,i,a),Xs(u,i,a))}function cv(i,a){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<a?u:a}}function dh(i,a){cv(i,a),(i=i.alternate)&&cv(i,a)}function fv(i){if(i.tag===13){var a=_a(i,67108864);a!==null&&mn(a,i,67108864),dh(i,67108864)}}var Nu=!0;function pT(i,a,u,h){var y=I.T;I.T=null;var v=P.p;try{P.p=2,hh(i,a,u,h)}finally{P.p=v,I.T=y}}function gT(i,a,u,h){var y=I.T;I.T=null;var v=P.p;try{P.p=8,hh(i,a,u,h)}finally{P.p=v,I.T=y}}function hh(i,a,u,h){if(Nu){var y=ph(h);if(y===null)eh(i,a,h,Ou,u),hv(i,h);else if(yT(y,i,a,u,h))h.stopPropagation();else if(hv(i,h),a&4&&-1<mT.indexOf(i)){for(;y!==null;){var v=pr(y);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var N=Zt(v.pendingLanes);if(N!==0){var z=v;for(z.pendingLanes|=2,z.entangledLanes|=2;N;){var Z=1<<31-Te(N);z.entanglements[1]|=Z,N&=~Z}rr(v),(We&6)===0&&(hu=xt()+500,dl(0))}}break;case 13:z=_a(v,2),z!==null&&mn(z,v,2),gu(),dh(v,2)}if(v=ph(h),v===null&&eh(i,a,h,Ou,u),v===y)break;y=v}y!==null&&h.stopPropagation()}else eh(i,a,h,null,u)}}function ph(i){return i=vf(i),gh(i)}var Ou=null;function gh(i){if(Ou=null,i=hr(i),i!==null){var a=l(i);if(a===null)i=null;else{var u=a.tag;if(u===13){if(i=o(a),i!==null)return i;i=null}else if(u===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;i=null}else a!==i&&(i=null)}}return Ou=i,null}function dv(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ai()){case fr:return 2;case Dn:return 8;case Xn:case dr:return 32;case Qn:return 268435456;default:return 32}default:return 32}}var mh=!1,li=null,oi=null,ui=null,xl=new Map,wl=new Map,ci=[],mT="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function hv(i,a){switch(i){case"focusin":case"focusout":li=null;break;case"dragenter":case"dragleave":oi=null;break;case"mouseover":case"mouseout":ui=null;break;case"pointerover":case"pointerout":xl.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":wl.delete(a.pointerId)}}function _l(i,a,u,h,y,v){return i===null||i.nativeEvent!==v?(i={blockedOn:a,domEventName:u,eventSystemFlags:h,nativeEvent:v,targetContainers:[y]},a!==null&&(a=pr(a),a!==null&&fv(a)),i):(i.eventSystemFlags|=h,a=i.targetContainers,y!==null&&a.indexOf(y)===-1&&a.push(y),i)}function yT(i,a,u,h,y){switch(a){case"focusin":return li=_l(li,i,a,u,h,y),!0;case"dragenter":return oi=_l(oi,i,a,u,h,y),!0;case"mouseover":return ui=_l(ui,i,a,u,h,y),!0;case"pointerover":var v=y.pointerId;return xl.set(v,_l(xl.get(v)||null,i,a,u,h,y)),!0;case"gotpointercapture":return v=y.pointerId,wl.set(v,_l(wl.get(v)||null,i,a,u,h,y)),!0}return!1}function pv(i){var a=hr(i.target);if(a!==null){var u=l(a);if(u!==null){if(a=u.tag,a===13){if(a=o(u),a!==null){i.blockedOn=a,cf(i.priority,function(){if(u.tag===13){var h=gn();h=ks(h);var y=_a(u,h);y!==null&&mn(y,u,h),dh(u,h)}});return}}else if(a===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Mu(i){if(i.blockedOn!==null)return!1;for(var a=i.targetContainers;0<a.length;){var u=ph(i.nativeEvent);if(u===null){u=i.nativeEvent;var h=new u.constructor(u.type,u);bf=h,u.target.dispatchEvent(h),bf=null}else return a=pr(u),a!==null&&fv(a),i.blockedOn=u,!1;a.shift()}return!0}function gv(i,a,u){Mu(i)&&u.delete(a)}function bT(){mh=!1,li!==null&&Mu(li)&&(li=null),oi!==null&&Mu(oi)&&(oi=null),ui!==null&&Mu(ui)&&(ui=null),xl.forEach(gv),wl.forEach(gv)}function Ru(i,a){i.blockedOn===a&&(i.blockedOn=null,mh||(mh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,bT)))}var Du=null;function mv(i){Du!==i&&(Du=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Du===i&&(Du=null);for(var a=0;a<i.length;a+=3){var u=i[a],h=i[a+1],y=i[a+2];if(typeof h!="function"){if(gh(h||u)===null)continue;break}var v=pr(u);v!==null&&(i.splice(a,3),a-=3,gd(v,{pending:!0,data:y,method:u.method,action:h},h,y))}}))}function Sl(i){function a(Z){return Ru(Z,i)}li!==null&&Ru(li,i),oi!==null&&Ru(oi,i),ui!==null&&Ru(ui,i),xl.forEach(a),wl.forEach(a);for(var u=0;u<ci.length;u++){var h=ci[u];h.blockedOn===i&&(h.blockedOn=null)}for(;0<ci.length&&(u=ci[0],u.blockedOn===null);)pv(u),u.blockedOn===null&&ci.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var y=u[h],v=u[h+1],N=y[Ut]||null;if(typeof v=="function")N||mv(u);else if(N){var z=null;if(v&&v.hasAttribute("formAction")){if(y=v,N=v[Ut]||null)z=N.formAction;else if(gh(y)!==null)continue}else z=N.action;typeof z=="function"?u[h+1]=z:(u.splice(h,3),h-=3),mv(u)}}}function yh(i){this._internalRoot=i}ju.prototype.render=yh.prototype.render=function(i){var a=this._internalRoot;if(a===null)throw Error(r(409));var u=a.current,h=gn();uv(u,h,i,a,null,null)},ju.prototype.unmount=yh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var a=i.containerInfo;uv(i.current,2,null,i,null,null),gu(),a[Br]=null}};function ju(i){this._internalRoot=i}ju.prototype.unstable_scheduleHydration=function(i){if(i){var a=xo();i={blockedOn:null,target:i,priority:a};for(var u=0;u<ci.length&&a!==0&&a<ci[u].priority;u++);ci.splice(u,0,i),u===0&&pv(i)}};var yv=t.version;if(yv!=="19.1.0")throw Error(r(527,yv,"19.1.0"));P.findDOMNode=function(i){var a=i._reactInternals;if(a===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=f(a),i=i!==null?d(i):null,i=i===null?null:i.stateNode,i};var vT={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zu.isDisabled&&zu.supportsFiber)try{se=zu.inject(vT),he=zu}catch{}}return El.createRoot=function(i,a){if(!s(i))throw Error(r(299));var u=!1,h="",y=D0,v=j0,N=z0,z=null;return a!=null&&(a.unstable_strictMode===!0&&(u=!0),a.identifierPrefix!==void 0&&(h=a.identifierPrefix),a.onUncaughtError!==void 0&&(y=a.onUncaughtError),a.onCaughtError!==void 0&&(v=a.onCaughtError),a.onRecoverableError!==void 0&&(N=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(z=a.unstable_transitionCallbacks)),a=lv(i,1,!1,null,null,u,h,y,v,N,z,null),i[Br]=a.current,Wd(i),new yh(a)},El.hydrateRoot=function(i,a,u){if(!s(i))throw Error(r(299));var h=!1,y="",v=D0,N=j0,z=z0,Z=null,re=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(v=u.onUncaughtError),u.onCaughtError!==void 0&&(N=u.onCaughtError),u.onRecoverableError!==void 0&&(z=u.onRecoverableError),u.unstable_transitionCallbacks!==void 0&&(Z=u.unstable_transitionCallbacks),u.formState!==void 0&&(re=u.formState)),a=lv(i,1,!0,a,u??null,h,y,v,N,z,Z,re),a.context=ov(null),u=a.current,h=gn(),h=ks(h),y=Zr(h),y.callback=null,Yr(u,y,h),u=h,a.current.lanes=u,Ci(a,u),rr(a),i[Br]=a.current,Wd(i),new ju(a)},El.version="19.1.0",El}var Tv;function OT(){if(Tv)return vh.exports;Tv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),vh.exports=NT(),vh.exports}var MT=OT();const RT=ki(MT);var W=so();const DT=ki(W),jT=({content:e})=>{const t=()=>typeof e=="string"?C.jsx("div",{className:"text-white whitespace-pre-wrap",children:e}):Array.isArray(e)?e.map((n,r)=>{switch(n.type){case"text":return C.jsx("div",{className:"text-white",children:n.text},r);case"image_url":return C.jsx("div",{className:"mt-2",children:C.jsx("img",{src:n.image_url.url,alt:"用户上传的图片",className:"max-w-[200px] rounded"})},r);case"audio":return C.jsx("div",{className:"mt-2",children:C.jsx("audio",{controls:!0,src:n.audio_url,className:"w-full",children:"您的浏览器不支持音频播放"})},r);default:return C.jsx("div",{className:"text-white whitespace-pre-wrap",children:JSON.stringify(n)},r)}}):C.jsx("div",{className:"text-white whitespace-pre-wrap",children:JSON.stringify(e)});return C.jsx("div",{className:"flex flex-row w-full justify-end",children:C.jsx("div",{className:"flex flex-col w-fit bg-blue-500 rounded-lg text-white border border-blue-100",children:C.jsx("div",{className:"flex flex-col p-4 ",children:t()})})})},kh=e=>e.toString(),rm=({usage_metadata:e,spend_time:t,response_metadata:n,id:r,tool_call_id:s})=>{const l=t?(e.output_tokens||0)*1e3/(t||1):0;return C.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500 mt-2",children:[C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsx(zT,{usage_metadata:e}),t&&C.jsxs("span",{className:"text-gray-500",children:[(t/1e3).toFixed(2),"s"]}),l&&C.jsxs("span",{className:"text-gray-500",children:[l.toFixed(2)," TPS"]})]}),C.jsxs("div",{className:"flex items-center gap-2",children:[(n==null?void 0:n.model_name)&&C.jsx("span",{className:"text-gray-600",children:n.model_name}),s&&C.jsxs("span",{className:"text-gray-500",children:["Tool: ",s]}),r&&C.jsxs("span",{className:"text-gray-500",children:["ID: ",r]})]})]})},zT=({usage_metadata:e})=>C.jsx("div",{className:"flex items-center gap-1",children:C.jsxs("span",{className:"flex items-center gap-1 group relative",children:[C.jsx("span",{children:"📊"}),kh(e.total_tokens||0),C.jsx("div",{className:"hidden group-hover:block absolute bottom-full ml-2 bg-gray-100 p-2 rounded text-xs shadow border",children:C.jsx("div",{className:"flex flex-col gap-1",children:C.jsxs("div",{className:"flex flex-col gap-1",children:[C.jsxs("span",{className:"flex items-center gap-1",children:[C.jsx("span",{children:"📥"}),kh(e.input_tokens||0),C.jsxs("div",{children:[" ",JSON.stringify(e.prompt_tokens_details)]})]}),C.jsxs("span",{className:"flex items-center gap-1",children:[C.jsx("span",{children:"📤"}),kh(e.output_tokens||0),C.jsxs("div",{children:[" ",JSON.stringify(e.completion_tokens_details)]})]})]})})})]})});var Al={exports:{}},Eh={},Ah,Cv;function LT(){if(Cv)return Ah;Cv=1;function e(t,n){typeof n=="boolean"&&(n={forever:n}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=n||{},this._maxRetryTime=n&&n.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}return Ah=e,e.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},e.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},e.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var n=new Date().getTime();if(t&&n-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1);else return!1;var s=this;return this._timer=setTimeout(function(){s._attempts++,s._operationTimeoutCb&&(s._timeout=setTimeout(function(){s._operationTimeoutCb(s._attempts)},s._operationTimeout),s._options.unref&&s._timeout.unref()),s._fn(s._attempts)},r),this._options.unref&&this._timer.unref(),!0},e.prototype.attempt=function(t,n){this._fn=t,n&&(n.timeout&&(this._operationTimeout=n.timeout),n.cb&&(this._operationTimeoutCb=n.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},e.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)},e.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)},e.prototype.start=e.prototype.try,e.prototype.errors=function(){return this._errors},e.prototype.attempts=function(){return this._attempts},e.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},n=null,r=0,s=0;s<this._errors.length;s++){var l=this._errors[s],o=l.message,c=(t[o]||0)+1;t[o]=c,c>=r&&(n=l,r=c)}return n},Ah}var Nv;function IT(){return Nv||(Nv=1,function(e){var t=LT();e.operation=function(n){var r=e.timeouts(n);return new t(r,{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(n){if(n instanceof Array)return[].concat(n);var r={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var s in n)r[s]=n[s];if(r.minTimeout>r.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var l=[],o=0;o<r.retries;o++)l.push(this.createTimeout(o,r));return n&&n.forever&&!l.length&&l.push(this.createTimeout(o,r)),l.sort(function(c,f){return c-f}),l},e.createTimeout=function(n,r){var s=r.randomize?Math.random()+1:1,l=Math.round(s*Math.max(r.minTimeout,1)*Math.pow(r.factor,n));return l=Math.min(l,r.maxTimeout),l},e.wrap=function(n,r,s){if(r instanceof Array&&(s=r,r=null),!s){s=[];for(var l in n)typeof n[l]=="function"&&s.push(l)}for(var o=0;o<s.length;o++){var c=s[o],f=n[c];n[c]=(function(p){var g=e.operation(r),m=Array.prototype.slice.call(arguments,1),b=m.pop();m.push(function(x){g.retry(x)||(x&&(arguments[0]=g.mainError()),b.apply(this,arguments))}),g.attempt(function(){p.apply(n,m)})}).bind(n,f),n[c].options=r}}}(Eh)),Eh}var Th,Ov;function BT(){return Ov||(Ov=1,Th=IT()),Th}var Mv;function FT(){if(Mv)return Al.exports;Mv=1;const e=BT(),t=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class n extends Error{constructor(c){super(),c instanceof Error?(this.originalError=c,{message:c}=c):(this.originalError=new Error(c),this.originalError.stack=this.stack),this.name="AbortError",this.message=c}}const r=(o,c,f)=>{const d=f.retries-(c-1);return o.attemptNumber=c,o.retriesLeft=d,o},s=o=>t.includes(o),l=(o,c)=>new Promise((f,d)=>{c={onFailedAttempt:()=>{},retries:10,...c};const p=e.operation(c);p.attempt(async g=>{try{f(await o(g))}catch(m){if(!(m instanceof Error)){d(new TypeError(`Non-error was thrown: "${m}". You should only throw errors.`));return}if(m instanceof n)p.stop(),d(m.originalError);else if(m instanceof TypeError&&!s(m.message))p.stop(),d(m);else{r(m,g,c);try{await c.onFailedAttempt(m)}catch(b){d(b);return}p.retry(m)||d(p.mainError())}}})});return Al.exports=l,Al.exports.default=l,Al.exports.AbortError=n,Al.exports}var PT=FT();const UT=ki(PT);var Lu={},Ch={exports:{}},Rv;function HT(){return Rv||(Rv=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function s(f,d,p){this.fn=f,this.context=d,this.once=p||!1}function l(f,d,p,g,m){if(typeof p!="function")throw new TypeError("The listener must be a function");var b=new s(p,g||f,m),x=n?n+d:d;return f._events[x]?f._events[x].fn?f._events[x]=[f._events[x],b]:f._events[x].push(b):(f._events[x]=b,f._eventsCount++),f}function o(f,d){--f._eventsCount===0?f._events=new r:delete f._events[d]}function c(){this._events=new r,this._eventsCount=0}c.prototype.eventNames=function(){var d=[],p,g;if(this._eventsCount===0)return d;for(g in p=this._events)t.call(p,g)&&d.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(p)):d},c.prototype.listeners=function(d){var p=n?n+d:d,g=this._events[p];if(!g)return[];if(g.fn)return[g.fn];for(var m=0,b=g.length,x=new Array(b);m<b;m++)x[m]=g[m].fn;return x},c.prototype.listenerCount=function(d){var p=n?n+d:d,g=this._events[p];return g?g.fn?1:g.length:0},c.prototype.emit=function(d,p,g,m,b,x){var w=n?n+d:d;if(!this._events[w])return!1;var _=this._events[w],k=arguments.length,A,S;if(_.fn){switch(_.once&&this.removeListener(d,_.fn,void 0,!0),k){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,p),!0;case 3:return _.fn.call(_.context,p,g),!0;case 4:return _.fn.call(_.context,p,g,m),!0;case 5:return _.fn.call(_.context,p,g,m,b),!0;case 6:return _.fn.call(_.context,p,g,m,b,x),!0}for(S=1,A=new Array(k-1);S<k;S++)A[S-1]=arguments[S];_.fn.apply(_.context,A)}else{var O=_.length,D;for(S=0;S<O;S++)switch(_[S].once&&this.removeListener(d,_[S].fn,void 0,!0),k){case 1:_[S].fn.call(_[S].context);break;case 2:_[S].fn.call(_[S].context,p);break;case 3:_[S].fn.call(_[S].context,p,g);break;case 4:_[S].fn.call(_[S].context,p,g,m);break;default:if(!A)for(D=1,A=new Array(k-1);D<k;D++)A[D-1]=arguments[D];_[S].fn.apply(_[S].context,A)}}return!0},c.prototype.on=function(d,p,g){return l(this,d,p,g,!1)},c.prototype.once=function(d,p,g){return l(this,d,p,g,!0)},c.prototype.removeListener=function(d,p,g,m){var b=n?n+d:d;if(!this._events[b])return this;if(!p)return o(this,b),this;var x=this._events[b];if(x.fn)x.fn===p&&(!m||x.once)&&(!g||x.context===g)&&o(this,b);else{for(var w=0,_=[],k=x.length;w<k;w++)(x[w].fn!==p||m&&!x[w].once||g&&x[w].context!==g)&&_.push(x[w]);_.length?this._events[b]=_.length===1?_[0]:_:o(this,b)}return this},c.prototype.removeAllListeners=function(d){var p;return d?(p=n?n+d:d,this._events[p]&&o(this,p)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c}(Ch)),Ch.exports}var Tl={exports:{}},Nh,Dv;function $T(){return Dv||(Dv=1,Nh=(e,t)=>(t=t||(()=>{}),e.then(n=>new Promise(r=>{r(t())}).then(()=>n),n=>new Promise(r=>{r(t())}).then(()=>{throw n})))),Nh}var jv;function VT(){if(jv)return Tl.exports;jv=1;const e=$T();class t extends Error{constructor(s){super(s),this.name="TimeoutError"}}const n=(r,s,l)=>new Promise((o,c)=>{if(typeof s!="number"||s<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(s===1/0){o(r);return}const f=setTimeout(()=>{if(typeof l=="function"){try{o(l())}catch(g){c(g)}return}const d=typeof l=="string"?l:`Promise timed out after ${s} milliseconds`,p=l instanceof Error?l:new t(d);typeof r.cancel=="function"&&r.cancel(),c(p)},s);e(r.then(o,c),()=>{clearTimeout(f)})});return Tl.exports=n,Tl.exports.default=n,Tl.exports.TimeoutError=t,Tl.exports}var Iu={},Bu={},zv;function qT(){if(zv)return Bu;zv=1,Object.defineProperty(Bu,"__esModule",{value:!0});function e(t,n,r){let s=0,l=t.length;for(;l>0;){const o=l/2|0;let c=s+o;r(t[c],n)<=0?(s=++c,l-=o+1):l=o}return s}return Bu.default=e,Bu}var Lv;function GT(){if(Lv)return Iu;Lv=1,Object.defineProperty(Iu,"__esModule",{value:!0});const e=qT();class t{constructor(){this._queue=[]}enqueue(r,s){s=Object.assign({priority:0},s);const l={priority:s.priority,run:r};if(this.size&&this._queue[this.size-1].priority>=s.priority){this._queue.push(l);return}const o=e.default(this._queue,l,(c,f)=>f.priority-c.priority);this._queue.splice(o,0,l)}dequeue(){const r=this._queue.shift();return r==null?void 0:r.run}filter(r){return this._queue.filter(s=>s.priority===r.priority).map(s=>s.run)}get size(){return this._queue.length}}return Iu.default=t,Iu}var Iv;function ZT(){if(Iv)return Lu;Iv=1,Object.defineProperty(Lu,"__esModule",{value:!0});const e=HT(),t=VT(),n=GT(),r=()=>{},s=new t.TimeoutError;class l extends e{constructor(c){var f,d,p,g;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=r,this._resolveIdle=r,c=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:n.default},c),!(typeof c.intervalCap=="number"&&c.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(d=(f=c.intervalCap)===null||f===void 0?void 0:f.toString())!==null&&d!==void 0?d:""}\` (${typeof c.intervalCap})`);if(c.interval===void 0||!(Number.isFinite(c.interval)&&c.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(g=(p=c.interval)===null||p===void 0?void 0:p.toString())!==null&&g!==void 0?g:""}\` (${typeof c.interval})`);this._carryoverConcurrencyCount=c.carryoverConcurrencyCount,this._isIntervalIgnored=c.intervalCap===1/0||c.interval===0,this._intervalCap=c.intervalCap,this._interval=c.interval,this._queue=new c.queueClass,this._queueClass=c.queueClass,this.concurrency=c.concurrency,this._timeout=c.timeout,this._throwOnTimeout=c.throwOnTimeout===!0,this._isPaused=c.autoStart===!1}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=r,this._pendingCount===0&&(this._resolveIdle(),this._resolveIdle=r,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){const c=Date.now();if(this._intervalId===void 0){const f=this._intervalEnd-c;if(f<0)this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0;else return this._timeoutId===void 0&&(this._timeoutId=setTimeout(()=>{this._onResumeInterval()},f)),!0}return!1}_tryToStartAnother(){if(this._queue.size===0)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const c=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const f=this._queue.dequeue();return f?(this.emit("active"),f(),c&&this._initializeIntervalIfNeeded(),!0):!1}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||this._intervalId!==void 0||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){this._intervalCount===0&&this._pendingCount===0&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(c){if(!(typeof c=="number"&&c>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${c}\` (${typeof c})`);this._concurrency=c,this._processQueue()}async add(c,f={}){return new Promise((d,p)=>{const g=async()=>{this._pendingCount++,this._intervalCount++;try{const m=this._timeout===void 0&&f.timeout===void 0?c():t.default(Promise.resolve(c()),f.timeout===void 0?this._timeout:f.timeout,()=>{(f.throwOnTimeout===void 0?this._throwOnTimeout:f.throwOnTimeout)&&p(s)});d(await m)}catch(m){p(m)}this._next()};this._queue.enqueue(g,f),this._tryToStartAnother(),this.emit("add")})}async addAll(c,f){return Promise.all(c.map(async d=>this.add(d,f)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size!==0)return new Promise(c=>{const f=this._resolveEmpty;this._resolveEmpty=()=>{f(),c()}})}async onIdle(){if(!(this._pendingCount===0&&this._queue.size===0))return new Promise(c=>{const f=this._resolveIdle;this._resolveIdle=()=>{f(),c()}})}get size(){return this._queue.size}sizeBy(c){return this._queue.filter(c).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(c){this._timeout=c}}return Lu.default=l,Lu}var YT=ZT();const Oh=ki(YT),XT=(...e)=>fetch(...e),QT=Symbol.for("lg:fetch_implementation"),KT=()=>globalThis[QT]??XT,JT=[400,401,402,403,404,405,406,407,408,409,422];function WT(e){return e==null||typeof e!="object"?!1:"status"in e&&"statusText"in e&&"text"in e}class Vl extends Error{constructor(t,n,r){super(`HTTP ${t}: ${n}`),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.status=t,this.text=n,this.response=r}static async fromResponse(t,n){try{return new Vl(t.status,await t.text(),n!=null&&n.includeResponse?t:void 0)}catch{return new Vl(t.status,t.statusText,n!=null&&n.includeResponse?t:void 0)}}}class eC{constructor(t){Object.defineProperty(this,"maxConcurrency",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxRetries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"queue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onFailedResponseHook",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"customFetch",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxConcurrency=t.maxConcurrency??1/0,this.maxRetries=t.maxRetries??4,"default"in Oh?this.queue=new Oh.default({concurrency:this.maxConcurrency}):this.queue=new Oh({concurrency:this.maxConcurrency}),this.onFailedResponseHook=t==null?void 0:t.onFailedResponseHook,this.customFetch=t.fetch}call(t,...n){const r=this.onFailedResponseHook;return this.queue.add(()=>UT(()=>t(...n).catch(async s=>{throw s instanceof Error?s:WT(s)?await Vl.fromResponse(s,{includeResponse:!!r}):new Error(s)}),{async onFailedAttempt(s){if(s.message.startsWith("Cancel")||s.message.startsWith("TimeoutError")||s.message.startsWith("AbortError")||(s==null?void 0:s.code)==="ECONNABORTED")throw s;if(s instanceof Vl){if(JT.includes(s.status))throw s;r&&s.response&&await r(s.response)}},retries:this.maxRetries,randomize:!0}),{throwOnTimeout:!0})}callWithOptions(t,n,...r){return t.signal?Promise.race([this.call(n,...r),new Promise((s,l)=>{var o;(o=t.signal)==null||o.addEventListener("abort",()=>{l(new Error("AbortError"))})})]):this.call(n,...r)}fetch(...t){const n=this.customFetch??KT();return this.call(()=>n(...t).then(r=>r.ok?r:Promise.reject(r)))}}var Mh={};function tC(e){try{return typeof process<"u"?Mh==null?void 0:Mh[e]:void 0}catch{return}}function nC(...e){const t=e.filter(r=>r!=null);if(t.length===0)return;if(t.length===1)return t[0];const n=new AbortController;for(const r of e){if(r!=null&&r.aborted)return n.abort(r.reason),n.signal;r==null||r.addEventListener("abort",()=>n.abort(r.reason),{once:!0})}return n.signal}const zl=13,gg=10,rC=0,Bv=58,iC=32,aC=[zl,gg];class Fv extends TransformStream{constructor(){let t=[],n=!1;super({start(){t=[],n=!1},transform(r,s){let l=r;if(n&&(l=rc([[zl],l]),n=!1),l.length>0&&l.at(-1)===zl&&(n=!0,l=l.subarray(0,-1)),!l.length)return;const o=aC.includes(l.at(-1)),c=l.length-1,{lines:f}=l.reduce((d,p,g)=>(d.from>g||((p===zl||p===gg)&&(d.lines.push(l.subarray(d.from,g)),p===zl&&l[g+1]===gg?d.from=g+2:d.from=g+1),g===c&&d.from<=c&&d.lines.push(l.subarray(d.from))),d),{lines:[],from:0});if(f.length===1&&!o){t.push(f[0]);return}t.length&&(t.push(f[0]),f[0]=rc(t),t=[]),o||f.length&&(t=[f.pop()]);for(const d of f)s.enqueue(d)},flush(r){t.length&&r.enqueue(rc(t))}})}}class Pv extends TransformStream{constructor(){let t="",n=[],r="",s=null;const l=new TextDecoder;super({transform(o,c){if(!o.length){if(!t&&!n.length&&!r&&s==null)return;const g={id:r||void 0,event:t,data:n.length?Uv(l,n):null};t="",n=[],s=null,c.enqueue(g);return}if(o[0]===Bv)return;const f=o.indexOf(Bv);if(f===-1)return;const d=l.decode(o.subarray(0,f));let p=o.subarray(f+1);if(p[0]===iC&&(p=p.subarray(1)),d==="event")t=l.decode(p);else if(d==="data")n.push(p);else if(d==="id")p.indexOf(rC)===-1&&(r=l.decode(p));else if(d==="retry"){const g=Number.parseInt(l.decode(p));Number.isNaN(g)||(s=g)}},flush(o){t&&o.enqueue({id:r||void 0,event:t,data:n.length?Uv(l,n):null})}})}}function rc(e){const t=e.reduce((s,l)=>s+l.length,0);let n=new Uint8Array(t),r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function Uv(e,t){return JSON.parse(e.decode(rc(t)))}class ql extends ReadableStream{constructor(){super(...arguments),Object.defineProperty(this,"reader",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}ensureReader(){this.reader||(this.reader=this.getReader())}async next(){this.ensureReader();try{const t=await this.reader.read();return t.done?(this.reader.releaseLock(),{done:!0,value:void 0}):{done:!1,value:t.value}}catch(t){throw this.reader.releaseLock(),t}}async return(){if(this.ensureReader(),this.locked){const t=this.reader.cancel();this.reader.releaseLock(),await t}return{done:!0,value:void 0}}async throw(t){if(this.ensureReader(),this.locked){const n=this.reader.cancel();this.reader.releaseLock(),await n}throw t}async[Symbol.asyncDispose](){await this.return()}[Symbol.asyncIterator](){return this}static fromReadableStream(t){const n=t.getReader();return new ql({start(r){return s();function s(){return n.read().then(({done:l,value:o})=>{if(l){r.close();return}return r.enqueue(o),s()})}},cancel(){n.releaseLock()}})}static fromAsyncGenerator(t){return new ql({async pull(n){const{value:r,done:s}=await t.next();s&&n.close(),n.enqueue(r)},async cancel(n){await t.return(n)}})}}function sC(e){if(e)return e;const t=["LANGGRAPH","LANGSMITH","LANGCHAIN"];for(const n of t){const r=tC(`${n}_API_KEY`);if(r)return r.trim().replace(/^["']|["']$/g,"")}}const lC=/(\/threads\/(?<thread_id>.+))?\/runs\/(?<run_id>.+)/;function Rh(e){var r;const t=e.headers.get("Content-Location");if(!t)return;const n=lC.exec(t);if((r=n==null?void 0:n.groups)!=null&&r.run_id)return{run_id:n.groups.run_id,thread_id:n.groups.thread_id||void 0}}class vs{constructor(t){var l;Object.defineProperty(this,"asyncCaller",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timeoutMs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"defaultHeaders",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const n={maxRetries:4,maxConcurrency:4,...t==null?void 0:t.callerOptions};let r="http://localhost:8123";if(!(t!=null&&t.apiUrl)&&typeof globalThis=="object"&&globalThis!=null){const o=Symbol.for("langgraph_api:fetch"),c=Symbol.for("langgraph_api:url"),f=globalThis;f[o]&&(n.fetch??(n.fetch=f[o])),f[c]&&(r=f[c])}this.asyncCaller=new eC(n),this.timeoutMs=t==null?void 0:t.timeoutMs,this.apiUrl=((l=t==null?void 0:t.apiUrl)==null?void 0:l.replace(/\/$/,""))||r,this.defaultHeaders=(t==null?void 0:t.defaultHeaders)||{};const s=sC(t==null?void 0:t.apiKey);s&&(this.defaultHeaders["X-Api-Key"]=s)}prepareFetchOptions(t,n){const r={...n,headers:{...this.defaultHeaders,...n==null?void 0:n.headers}};r.json&&(r.body=JSON.stringify(r.json),r.headers={...r.headers,"Content-Type":"application/json"},delete r.json),r.withResponse&&delete r.withResponse;let s=null;typeof(n==null?void 0:n.timeoutMs)<"u"?n.timeoutMs!=null&&(s=AbortSignal.timeout(n.timeoutMs)):this.timeoutMs!=null&&(s=AbortSignal.timeout(this.timeoutMs)),r.signal=nC(s,r.signal);const l=new URL(`${this.apiUrl}${t}`);if(r.params){for(const[o,c]of Object.entries(r.params)){if(c==null)continue;let f=typeof c=="string"||typeof c=="number"?c.toString():JSON.stringify(c);l.searchParams.append(o,f)}delete r.params}return[l,r]}async fetch(t,n){const r=await this.asyncCaller.fetch(...this.prepareFetchOptions(t,n)),s=(()=>{if(!(r.status===202||r.status===204))return r.json()})();return n!=null&&n.withResponse?[await s,r]:s}}class oC extends vs{async createForThread(t,n,r){const s={schedule:r==null?void 0:r.schedule,input:r==null?void 0:r.input,config:r==null?void 0:r.config,metadata:r==null?void 0:r.metadata,assistant_id:n,interrupt_before:r==null?void 0:r.interruptBefore,interrupt_after:r==null?void 0:r.interruptAfter,webhook:r==null?void 0:r.webhook,multitask_strategy:r==null?void 0:r.multitaskStrategy,if_not_exists:r==null?void 0:r.ifNotExists,checkpoint_during:r==null?void 0:r.checkpointDuring};return this.fetch(`/threads/${t}/runs/crons`,{method:"POST",json:s})}async create(t,n){const r={schedule:n==null?void 0:n.schedule,input:n==null?void 0:n.input,config:n==null?void 0:n.config,metadata:n==null?void 0:n.metadata,assistant_id:t,interrupt_before:n==null?void 0:n.interruptBefore,interrupt_after:n==null?void 0:n.interruptAfter,webhook:n==null?void 0:n.webhook,multitask_strategy:n==null?void 0:n.multitaskStrategy,if_not_exists:n==null?void 0:n.ifNotExists,checkpoint_during:n==null?void 0:n.checkpointDuring};return this.fetch("/runs/crons",{method:"POST",json:r})}async delete(t){await this.fetch(`/runs/crons/${t}`,{method:"DELETE"})}async search(t){return this.fetch("/runs/crons/search",{method:"POST",json:{assistant_id:(t==null?void 0:t.assistantId)??void 0,thread_id:(t==null?void 0:t.threadId)??void 0,limit:(t==null?void 0:t.limit)??10,offset:(t==null?void 0:t.offset)??0}})}}class uC extends vs{async get(t){return this.fetch(`/assistants/${t}`)}async getGraph(t,n){return this.fetch(`/assistants/${t}/graph`,{params:{xray:n==null?void 0:n.xray}})}async getSchemas(t){return this.fetch(`/assistants/${t}/schemas`)}async getSubgraphs(t,n){return n!=null&&n.namespace?this.fetch(`/assistants/${t}/subgraphs/${n.namespace}`,{params:{recurse:n==null?void 0:n.recurse}}):this.fetch(`/assistants/${t}/subgraphs`,{params:{recurse:n==null?void 0:n.recurse}})}async create(t){return this.fetch("/assistants",{method:"POST",json:{graph_id:t.graphId,config:t.config,metadata:t.metadata,assistant_id:t.assistantId,if_exists:t.ifExists,name:t.name,description:t.description}})}async update(t,n){return this.fetch(`/assistants/${t}`,{method:"PATCH",json:{graph_id:n.graphId,config:n.config,metadata:n.metadata,name:n.name,description:n.description}})}async delete(t){return this.fetch(`/assistants/${t}`,{method:"DELETE"})}async search(t){return this.fetch("/assistants/search",{method:"POST",json:{graph_id:(t==null?void 0:t.graphId)??void 0,metadata:(t==null?void 0:t.metadata)??void 0,limit:(t==null?void 0:t.limit)??10,offset:(t==null?void 0:t.offset)??0,sort_by:(t==null?void 0:t.sortBy)??void 0,sort_order:(t==null?void 0:t.sortOrder)??void 0}})}async getVersions(t,n){return this.fetch(`/assistants/${t}/versions`,{method:"POST",json:{metadata:(n==null?void 0:n.metadata)??void 0,limit:(n==null?void 0:n.limit)??10,offset:(n==null?void 0:n.offset)??0}})}async setLatest(t,n){return this.fetch(`/assistants/${t}/latest`,{method:"POST",json:{version:n}})}}class cC extends vs{async get(t){return this.fetch(`/threads/${t}`)}async create(t){var n;return this.fetch("/threads",{method:"POST",json:{metadata:{...t==null?void 0:t.metadata,graph_id:t==null?void 0:t.graphId},thread_id:t==null?void 0:t.threadId,if_exists:t==null?void 0:t.ifExists,supersteps:(n=t==null?void 0:t.supersteps)==null?void 0:n.map(r=>({updates:r.updates.map(s=>({values:s.values,command:s.command,as_node:s.asNode}))}))}})}async copy(t){return this.fetch(`/threads/${t}/copy`,{method:"POST"})}async update(t,n){return this.fetch(`/threads/${t}`,{method:"PATCH",json:{metadata:n==null?void 0:n.metadata}})}async delete(t){return this.fetch(`/threads/${t}`,{method:"DELETE"})}async search(t){return this.fetch("/threads/search",{method:"POST",json:{metadata:(t==null?void 0:t.metadata)??void 0,limit:(t==null?void 0:t.limit)??10,offset:(t==null?void 0:t.offset)??0,status:t==null?void 0:t.status,sort_by:t==null?void 0:t.sortBy,sort_order:t==null?void 0:t.sortOrder}})}async getState(t,n,r){return n!=null?typeof n!="string"?this.fetch(`/threads/${t}/state/checkpoint`,{method:"POST",json:{checkpoint:n,subgraphs:r==null?void 0:r.subgraphs}}):this.fetch(`/threads/${t}/state/${n}`,{params:{subgraphs:r==null?void 0:r.subgraphs}}):this.fetch(`/threads/${t}/state`,{params:{subgraphs:r==null?void 0:r.subgraphs}})}async updateState(t,n){return this.fetch(`/threads/${t}/state`,{method:"POST",json:{values:n.values,checkpoint_id:n.checkpointId,checkpoint:n.checkpoint,as_node:n==null?void 0:n.asNode}})}async patchState(t,n){var s;let r;if(typeof t!="string"){if(typeof((s=t.configurable)==null?void 0:s.thread_id)!="string")throw new Error("Thread ID is required when updating state with a config.");r=t.configurable.thread_id}else r=t;return this.fetch(`/threads/${r}/state`,{method:"PATCH",json:{metadata:n}})}async getHistory(t,n){return this.fetch(`/threads/${t}/history`,{method:"POST",json:{limit:(n==null?void 0:n.limit)??10,before:n==null?void 0:n.before,metadata:n==null?void 0:n.metadata,checkpoint:n==null?void 0:n.checkpoint}})}}class fC extends vs{async*stream(t,n,r){var d;const s={input:r==null?void 0:r.input,command:r==null?void 0:r.command,config:r==null?void 0:r.config,metadata:r==null?void 0:r.metadata,stream_mode:r==null?void 0:r.streamMode,stream_subgraphs:r==null?void 0:r.streamSubgraphs,stream_resumable:r==null?void 0:r.streamResumable,feedback_keys:r==null?void 0:r.feedbackKeys,assistant_id:n,interrupt_before:r==null?void 0:r.interruptBefore,interrupt_after:r==null?void 0:r.interruptAfter,checkpoint:r==null?void 0:r.checkpoint,checkpoint_id:r==null?void 0:r.checkpointId,webhook:r==null?void 0:r.webhook,multitask_strategy:r==null?void 0:r.multitaskStrategy,on_completion:r==null?void 0:r.onCompletion,on_disconnect:r==null?void 0:r.onDisconnect,after_seconds:r==null?void 0:r.afterSeconds,if_not_exists:r==null?void 0:r.ifNotExists,checkpoint_during:r==null?void 0:r.checkpointDuring},l=t==null?"/runs/stream":`/threads/${t}/runs/stream`,o=await this.asyncCaller.fetch(...this.prepareFetchOptions(l,{method:"POST",json:s,timeoutMs:null,signal:r==null?void 0:r.signal})),c=Rh(o);c&&((d=r==null?void 0:r.onRunCreated)==null||d.call(r,c));const f=(o.body||new ReadableStream({start:p=>p.close()})).pipeThrough(new Fv).pipeThrough(new Pv);yield*ql.fromReadableStream(f)}async create(t,n,r){var f;const s={input:r==null?void 0:r.input,command:r==null?void 0:r.command,config:r==null?void 0:r.config,metadata:r==null?void 0:r.metadata,stream_mode:r==null?void 0:r.streamMode,stream_subgraphs:r==null?void 0:r.streamSubgraphs,stream_resumable:r==null?void 0:r.streamResumable,assistant_id:n,interrupt_before:r==null?void 0:r.interruptBefore,interrupt_after:r==null?void 0:r.interruptAfter,webhook:r==null?void 0:r.webhook,checkpoint:r==null?void 0:r.checkpoint,checkpoint_id:r==null?void 0:r.checkpointId,multitask_strategy:r==null?void 0:r.multitaskStrategy,after_seconds:r==null?void 0:r.afterSeconds,if_not_exists:r==null?void 0:r.ifNotExists,checkpoint_during:r==null?void 0:r.checkpointDuring},[l,o]=await this.fetch(`/threads/${t}/runs`,{method:"POST",json:s,signal:r==null?void 0:r.signal,withResponse:!0}),c=Rh(o);return c&&((f=r==null?void 0:r.onRunCreated)==null||f.call(r,c)),l}async createBatch(t){const n=t.map(r=>({...r,assistant_id:r.assistantId})).map(r=>Object.fromEntries(Object.entries(r).filter(([s,l])=>l!==void 0)));return this.fetch("/runs/batch",{method:"POST",json:n})}async wait(t,n,r){var p,g,m;const s={input:r==null?void 0:r.input,command:r==null?void 0:r.command,config:r==null?void 0:r.config,metadata:r==null?void 0:r.metadata,assistant_id:n,interrupt_before:r==null?void 0:r.interruptBefore,interrupt_after:r==null?void 0:r.interruptAfter,checkpoint:r==null?void 0:r.checkpoint,checkpoint_id:r==null?void 0:r.checkpointId,webhook:r==null?void 0:r.webhook,multitask_strategy:r==null?void 0:r.multitaskStrategy,on_completion:r==null?void 0:r.onCompletion,on_disconnect:r==null?void 0:r.onDisconnect,after_seconds:r==null?void 0:r.afterSeconds,if_not_exists:r==null?void 0:r.ifNotExists,checkpoint_during:r==null?void 0:r.checkpointDuring},l=t==null?"/runs/wait":`/threads/${t}/runs/wait`,[o,c]=await this.fetch(l,{method:"POST",json:s,timeoutMs:null,signal:r==null?void 0:r.signal,withResponse:!0}),f=Rh(c);if(f&&((p=r==null?void 0:r.onRunCreated)==null||p.call(r,f)),((r==null?void 0:r.raiseError)!==void 0?r.raiseError:!0)&&"__error__"in o&&typeof o.__error__=="object"&&o.__error__&&"error"in o.__error__&&"message"in o.__error__)throw new Error(`${(g=o.__error__)==null?void 0:g.error}: ${(m=o.__error__)==null?void 0:m.message}`);return o}async list(t,n){return this.fetch(`/threads/${t}/runs`,{params:{limit:(n==null?void 0:n.limit)??10,offset:(n==null?void 0:n.offset)??0,status:(n==null?void 0:n.status)??void 0}})}async get(t,n){return this.fetch(`/threads/${t}/runs/${n}`)}async cancel(t,n,r=!1,s="interrupt"){return this.fetch(`/threads/${t}/runs/${n}/cancel`,{method:"POST",params:{wait:r?"1":"0",action:s}})}async join(t,n,r){return this.fetch(`/threads/${t}/runs/${n}/join`,{timeoutMs:null,signal:r==null?void 0:r.signal})}async*joinStream(t,n,r){const s=typeof r=="object"&&r!=null&&r instanceof AbortSignal?{signal:r}:r,o=((await this.asyncCaller.fetch(...this.prepareFetchOptions(t!=null?`/threads/${t}/runs/${n}/stream`:`/runs/${n}/stream`,{method:"GET",timeoutMs:null,signal:s==null?void 0:s.signal,headers:s!=null&&s.lastEventId?{"Last-Event-ID":s.lastEventId}:void 0,params:{cancel_on_disconnect:s!=null&&s.cancelOnDisconnect?"1":"0",stream_mode:s==null?void 0:s.streamMode}}))).body||new ReadableStream({start:c=>c.close()})).pipeThrough(new Fv).pipeThrough(new Pv);yield*ql.fromReadableStream(o)}async delete(t,n){return this.fetch(`/threads/${t}/runs/${n}`,{method:"DELETE"})}}class dC extends vs{async putItem(t,n,r,s){t.forEach(o=>{if(o.includes("."))throw new Error(`Invalid namespace label '${o}'. Namespace labels cannot contain periods ('.')`)});const l={namespace:t,key:n,value:r,index:s==null?void 0:s.index,ttl:s==null?void 0:s.ttl};return this.fetch("/store/items",{method:"PUT",json:l})}async getItem(t,n,r){t.forEach(o=>{if(o.includes("."))throw new Error(`Invalid namespace label '${o}'. Namespace labels cannot contain periods ('.')`)});const s={namespace:t.join("."),key:n};(r==null?void 0:r.refreshTtl)!==void 0&&(s.refresh_ttl=r.refreshTtl);const l=await this.fetch("/store/items",{params:s});return l?{...l,createdAt:l.created_at,updatedAt:l.updated_at}:null}async deleteItem(t,n){return t.forEach(r=>{if(r.includes("."))throw new Error(`Invalid namespace label '${r}'. Namespace labels cannot contain periods ('.')`)}),this.fetch("/store/items",{method:"DELETE",json:{namespace:t,key:n}})}async searchItems(t,n){const r={namespace_prefix:t,filter:n==null?void 0:n.filter,limit:(n==null?void 0:n.limit)??10,offset:(n==null?void 0:n.offset)??0,query:n==null?void 0:n.query,refresh_ttl:n==null?void 0:n.refreshTtl};return{items:(await this.fetch("/store/items/search",{method:"POST",json:r})).items.map(l=>({...l,createdAt:l.created_at,updatedAt:l.updated_at}))}}async listNamespaces(t){const n={prefix:t==null?void 0:t.prefix,suffix:t==null?void 0:t.suffix,max_depth:t==null?void 0:t.maxDepth,limit:(t==null?void 0:t.limit)??100,offset:(t==null?void 0:t.offset)??0};return this.fetch("/store/namespaces",{method:"POST",json:n})}}class Ki extends vs{static getOrCached(t,n){if(Ki.promiseCache[t]!=null)return Ki.promiseCache[t];const r=n();return Ki.promiseCache[t]=r,r}async getComponent(t,n){return Ki.getOrCached(`${this.apiUrl}-${t}-${n}`,async()=>(await this.asyncCaller.fetch(...this.prepareFetchOptions(`/ui/${t}`,{headers:{Accept:"text/html","Content-Type":"application/json"},method:"POST",json:{name:n}}))).text())}}Object.defineProperty(Ki,"promiseCache",{enumerable:!0,configurable:!0,writable:!0,value:{}});class hC{constructor(t){Object.defineProperty(this,"assistants",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"threads",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"runs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"crons",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"store",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"~ui",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.assistants=new uC(t),this.threads=new cC(t),this.runs=new fC(t),this.crons=new oC(t),this.store=new dC(t),this["~ui"]=new Ki(t)}}var Xe;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const l={};for(const o of s)l[o]=o;return l},e.getValidEnumValues=s=>{const l=e.objectKeys(s).filter(c=>typeof s[s[c]]!="number"),o={};for(const c of l)o[c]=s[c];return e.objectValues(o)},e.objectValues=s=>e.objectKeys(s).map(function(l){return s[l]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const l=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&l.push(o);return l},e.find=(s,l)=>{for(const o of s)if(l(o))return o},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,l=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(l)}e.joinValues=r,e.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Xe||(Xe={}));var Hv;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Hv||(Hv={}));const we=Xe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),mi=e=>{switch(typeof e){case"undefined":return we.undefined;case"string":return we.string;case"number":return Number.isNaN(e)?we.nan:we.number;case"boolean":return we.boolean;case"function":return we.function;case"bigint":return we.bigint;case"symbol":return we.symbol;case"object":return Array.isArray(e)?we.array:e===null?we.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?we.promise:typeof Map<"u"&&e instanceof Map?we.map:typeof Set<"u"&&e instanceof Set?we.set:typeof Date<"u"&&e instanceof Date?we.date:we.object;default:return we.unknown}},ge=Xe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class jr extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(l){return l.message},r={_errors:[]},s=l=>{for(const o of l.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let c=r,f=0;for(;f<o.path.length;){const d=o.path[f];f===o.path.length-1?(c[d]=c[d]||{_errors:[]},c[d]._errors.push(n(o))):c[d]=c[d]||{_errors:[]},c=c[d],f++}}};return s(this),r}static assert(t){if(!(t instanceof jr))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Xe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}jr.create=e=>new jr(e);const mg=(e,t)=>{let n;switch(e.code){case ge.invalid_type:e.received===we.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ge.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Xe.jsonStringifyReplacer)}`;break;case ge.unrecognized_keys:n=`Unrecognized key(s) in object: ${Xe.joinValues(e.keys,", ")}`;break;case ge.invalid_union:n="Invalid input";break;case ge.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Xe.joinValues(e.options)}`;break;case ge.invalid_enum_value:n=`Invalid enum value. Expected ${Xe.joinValues(e.options)}, received '${e.received}'`;break;case ge.invalid_arguments:n="Invalid function arguments";break;case ge.invalid_return_type:n="Invalid function return type";break;case ge.invalid_date:n="Invalid date";break;case ge.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Xe.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ge.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ge.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ge.custom:n="Invalid input";break;case ge.invalid_intersection_types:n="Intersection results could not be merged";break;case ge.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ge.not_finite:n="Number must be finite";break;default:n=t.defaultError,Xe.assertNever(e)}return{message:n}};let pC=mg;function gC(){return pC}const mC=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,l=[...n,...s.path||[]],o={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let c="";const f=r.filter(d=>!!d).slice().reverse();for(const d of f)c=d(o,{data:t,defaultError:c}).message;return{...s,path:l,message:c}};function ve(e,t){const n=gC(),r=mC({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===mg?void 0:mg].filter(s=>!!s)});e.common.issues.push(r)}class wn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return De;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const l=await s.key,o=await s.value;r.push({key:l,value:o})}return wn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:l,value:o}=s;if(l.status==="aborted"||o.status==="aborted")return De;l.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),l.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[l.value]=o.value)}return{status:t.value,value:r}}}const De=Object.freeze({status:"aborted"}),Ll=e=>({status:"dirty",value:e}),Rn=e=>({status:"valid",value:e}),$v=e=>e.status==="aborted",Vv=e=>e.status==="dirty",ss=e=>e.status==="valid",dc=e=>typeof Promise<"u"&&e instanceof Promise;var _e;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(_e||(_e={}));class _i{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const qv=(e,t)=>{if(ss(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new jr(e.common.issues);return this._error=n,this._error}}};function Pe(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(o,c)=>{const{message:f}=e;return o.code==="invalid_enum_value"?{message:f??c.defaultError}:typeof c.data>"u"?{message:f??r??c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:f??n??c.defaultError}},description:s}}class Ze{get description(){return this._def.description}_getType(t){return mi(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:mi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new wn,ctx:{common:t.parent.common,data:t.data,parsedType:mi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(dc(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:mi(t)},s=this._parseSync({data:t,path:r.path,parent:r});return qv(r,s)}"~validate"(t){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:mi(t)};if(!this["~standard"].async)try{const l=this._parseSync({data:t,path:[],parent:n});return ss(l)?{value:l.value}:{issues:n.common.issues}}catch(l){(s=(r=l==null?void 0:l.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(l=>ss(l)?{value:l.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:mi(t)},s=this._parse({data:t,path:r.path,parent:r}),l=await(dc(s)?s:Promise.resolve(s));return qv(r,l)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const o=t(s),c=()=>l.addIssue({code:ge.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(f=>f?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new us({schema:this,typeName:me.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Rr.create(this,this._def)}nullable(){return cs.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ar.create(this)}promise(){return mc.create(this,this._def)}or(t){return pc.create([this,t],this._def)}and(t){return gc.create(this,t,this._def)}transform(t){return new us({...Pe(this._def),schema:this,typeName:me.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new vg({...Pe(this._def),innerType:this,defaultValue:n,typeName:me.ZodDefault})}brand(){return new FC({typeName:me.ZodBranded,type:this,...Pe(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new xg({...Pe(this._def),innerType:this,catchValue:n,typeName:me.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return im.create(this,t)}readonly(){return wg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const yC=/^c[^\s-]{8,}$/i,bC=/^[0-9a-z]+$/,vC=/^[0-9A-HJKMNP-TV-Z]{26}$/i,xC=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,wC=/^[a-z0-9_-]{21}$/i,_C=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,SC=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,kC=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,EC="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Dh;const AC=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,TC=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,CC=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,NC=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,OC=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,MC=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,A_="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",RC=new RegExp(`^${A_}$`);function T_(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function DC(e){return new RegExp(`^${T_(e)}$`)}function jC(e){let t=`${A_}T${T_(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function zC(e,t){return!!((t==="v4"||!t)&&AC.test(e)||(t==="v6"||!t)&&CC.test(e))}function LC(e,t){if(!_C.test(e))return!1;try{const[n]=e.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function IC(e,t){return!!((t==="v4"||!t)&&TC.test(e)||(t==="v6"||!t)&&NC.test(e))}class vi extends Ze{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==we.string){const l=this._getOrReturnCtx(t);return ve(l,{code:ge.invalid_type,expected:we.string,received:l.parsedType}),De}const r=new wn;let s;for(const l of this._def.checks)if(l.kind==="min")t.data.length<l.value&&(s=this._getOrReturnCtx(t,s),ve(s,{code:ge.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),r.dirty());else if(l.kind==="max")t.data.length>l.value&&(s=this._getOrReturnCtx(t,s),ve(s,{code:ge.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),r.dirty());else if(l.kind==="length"){const o=t.data.length>l.value,c=t.data.length<l.value;(o||c)&&(s=this._getOrReturnCtx(t,s),o?ve(s,{code:ge.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):c&&ve(s,{code:ge.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),r.dirty())}else if(l.kind==="email")kC.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"email",code:ge.invalid_string,message:l.message}),r.dirty());else if(l.kind==="emoji")Dh||(Dh=new RegExp(EC,"u")),Dh.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"emoji",code:ge.invalid_string,message:l.message}),r.dirty());else if(l.kind==="uuid")xC.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"uuid",code:ge.invalid_string,message:l.message}),r.dirty());else if(l.kind==="nanoid")wC.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"nanoid",code:ge.invalid_string,message:l.message}),r.dirty());else if(l.kind==="cuid")yC.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"cuid",code:ge.invalid_string,message:l.message}),r.dirty());else if(l.kind==="cuid2")bC.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"cuid2",code:ge.invalid_string,message:l.message}),r.dirty());else if(l.kind==="ulid")vC.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"ulid",code:ge.invalid_string,message:l.message}),r.dirty());else if(l.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),ve(s,{validation:"url",code:ge.invalid_string,message:l.message}),r.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"regex",code:ge.invalid_string,message:l.message}),r.dirty())):l.kind==="trim"?t.data=t.data.trim():l.kind==="includes"?t.data.includes(l.value,l.position)||(s=this._getOrReturnCtx(t,s),ve(s,{code:ge.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),r.dirty()):l.kind==="toLowerCase"?t.data=t.data.toLowerCase():l.kind==="toUpperCase"?t.data=t.data.toUpperCase():l.kind==="startsWith"?t.data.startsWith(l.value)||(s=this._getOrReturnCtx(t,s),ve(s,{code:ge.invalid_string,validation:{startsWith:l.value},message:l.message}),r.dirty()):l.kind==="endsWith"?t.data.endsWith(l.value)||(s=this._getOrReturnCtx(t,s),ve(s,{code:ge.invalid_string,validation:{endsWith:l.value},message:l.message}),r.dirty()):l.kind==="datetime"?jC(l).test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{code:ge.invalid_string,validation:"datetime",message:l.message}),r.dirty()):l.kind==="date"?RC.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{code:ge.invalid_string,validation:"date",message:l.message}),r.dirty()):l.kind==="time"?DC(l).test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{code:ge.invalid_string,validation:"time",message:l.message}),r.dirty()):l.kind==="duration"?SC.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"duration",code:ge.invalid_string,message:l.message}),r.dirty()):l.kind==="ip"?zC(t.data,l.version)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"ip",code:ge.invalid_string,message:l.message}),r.dirty()):l.kind==="jwt"?LC(t.data,l.alg)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"jwt",code:ge.invalid_string,message:l.message}),r.dirty()):l.kind==="cidr"?IC(t.data,l.version)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"cidr",code:ge.invalid_string,message:l.message}),r.dirty()):l.kind==="base64"?OC.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"base64",code:ge.invalid_string,message:l.message}),r.dirty()):l.kind==="base64url"?MC.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"base64url",code:ge.invalid_string,message:l.message}),r.dirty()):Xe.assertNever(l);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:ge.invalid_string,..._e.errToObj(r)})}_addCheck(t){return new vi({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",..._e.errToObj(t)})}url(t){return this._addCheck({kind:"url",..._e.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",..._e.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",..._e.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",..._e.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",..._e.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",..._e.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",..._e.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",..._e.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",..._e.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",..._e.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",..._e.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",..._e.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,..._e.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,..._e.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",..._e.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,..._e.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,..._e.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,..._e.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,..._e.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,..._e.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,..._e.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,..._e.errToObj(n)})}nonempty(t){return this.min(1,_e.errToObj(t))}trim(){return new vi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new vi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new vi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}vi.create=e=>new vi({checks:[],typeName:me.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Pe(e)});function BC(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,l=Number.parseInt(e.toFixed(s).replace(".","")),o=Number.parseInt(t.toFixed(s).replace(".",""));return l%o/10**s}class ls extends Ze{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==we.number){const l=this._getOrReturnCtx(t);return ve(l,{code:ge.invalid_type,expected:we.number,received:l.parsedType}),De}let r;const s=new wn;for(const l of this._def.checks)l.kind==="int"?Xe.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ve(r,{code:ge.invalid_type,expected:"integer",received:"float",message:l.message}),s.dirty()):l.kind==="min"?(l.inclusive?t.data<l.value:t.data<=l.value)&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ge.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?t.data>l.value:t.data>=l.value)&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ge.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?BC(t.data,l.value)!==0&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ge.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ve(r,{code:ge.not_finite,message:l.message}),s.dirty()):Xe.assertNever(l);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,_e.toString(n))}gt(t,n){return this.setLimit("min",t,!1,_e.toString(n))}lte(t,n){return this.setLimit("max",t,!0,_e.toString(n))}lt(t,n){return this.setLimit("max",t,!1,_e.toString(n))}setLimit(t,n,r,s){return new ls({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:_e.toString(s)}]})}_addCheck(t){return new ls({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:_e.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_e.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_e.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_e.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_e.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:_e.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:_e.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_e.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_e.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Xe.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}ls.create=e=>new ls({checks:[],typeName:me.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Pe(e)});class Gl extends Ze{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==we.bigint)return this._getInvalidInput(t);let r;const s=new wn;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?t.data<l.value:t.data<=l.value)&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ge.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?t.data>l.value:t.data>=l.value)&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ge.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="multipleOf"?t.data%l.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ge.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):Xe.assertNever(l);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return ve(n,{code:ge.invalid_type,expected:we.bigint,received:n.parsedType}),De}gte(t,n){return this.setLimit("min",t,!0,_e.toString(n))}gt(t,n){return this.setLimit("min",t,!1,_e.toString(n))}lte(t,n){return this.setLimit("max",t,!0,_e.toString(n))}lt(t,n){return this.setLimit("max",t,!1,_e.toString(n))}setLimit(t,n,r,s){return new Gl({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:_e.toString(s)}]})}_addCheck(t){return new Gl({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_e.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_e.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_e.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_e.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:_e.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Gl.create=e=>new Gl({checks:[],typeName:me.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Pe(e)});class yg extends Ze{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==we.boolean){const r=this._getOrReturnCtx(t);return ve(r,{code:ge.invalid_type,expected:we.boolean,received:r.parsedType}),De}return Rn(t.data)}}yg.create=e=>new yg({typeName:me.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Pe(e)});class hc extends Ze{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==we.date){const l=this._getOrReturnCtx(t);return ve(l,{code:ge.invalid_type,expected:we.date,received:l.parsedType}),De}if(Number.isNaN(t.data.getTime())){const l=this._getOrReturnCtx(t);return ve(l,{code:ge.invalid_date}),De}const r=new wn;let s;for(const l of this._def.checks)l.kind==="min"?t.data.getTime()<l.value&&(s=this._getOrReturnCtx(t,s),ve(s,{code:ge.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),r.dirty()):l.kind==="max"?t.data.getTime()>l.value&&(s=this._getOrReturnCtx(t,s),ve(s,{code:ge.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),r.dirty()):Xe.assertNever(l);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new hc({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:_e.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:_e.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}hc.create=e=>new hc({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:me.ZodDate,...Pe(e)});class Gv extends Ze{_parse(t){if(this._getType(t)!==we.symbol){const r=this._getOrReturnCtx(t);return ve(r,{code:ge.invalid_type,expected:we.symbol,received:r.parsedType}),De}return Rn(t.data)}}Gv.create=e=>new Gv({typeName:me.ZodSymbol,...Pe(e)});class Zv extends Ze{_parse(t){if(this._getType(t)!==we.undefined){const r=this._getOrReturnCtx(t);return ve(r,{code:ge.invalid_type,expected:we.undefined,received:r.parsedType}),De}return Rn(t.data)}}Zv.create=e=>new Zv({typeName:me.ZodUndefined,...Pe(e)});class Yv extends Ze{_parse(t){if(this._getType(t)!==we.null){const r=this._getOrReturnCtx(t);return ve(r,{code:ge.invalid_type,expected:we.null,received:r.parsedType}),De}return Rn(t.data)}}Yv.create=e=>new Yv({typeName:me.ZodNull,...Pe(e)});class Xv extends Ze{constructor(){super(...arguments),this._any=!0}_parse(t){return Rn(t.data)}}Xv.create=e=>new Xv({typeName:me.ZodAny,...Pe(e)});class Qv extends Ze{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Rn(t.data)}}Qv.create=e=>new Qv({typeName:me.ZodUnknown,...Pe(e)});class Si extends Ze{_parse(t){const n=this._getOrReturnCtx(t);return ve(n,{code:ge.invalid_type,expected:we.never,received:n.parsedType}),De}}Si.create=e=>new Si({typeName:me.ZodNever,...Pe(e)});class Kv extends Ze{_parse(t){if(this._getType(t)!==we.undefined){const r=this._getOrReturnCtx(t);return ve(r,{code:ge.invalid_type,expected:we.void,received:r.parsedType}),De}return Rn(t.data)}}Kv.create=e=>new Kv({typeName:me.ZodVoid,...Pe(e)});class ar extends Ze{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==we.array)return ve(n,{code:ge.invalid_type,expected:we.array,received:n.parsedType}),De;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,c=n.data.length<s.exactLength.value;(o||c)&&(ve(n,{code:o?ge.too_big:ge.too_small,minimum:c?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ve(n,{code:ge.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ve(n,{code:ge.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,c)=>s.type._parseAsync(new _i(n,o,n.path,c)))).then(o=>wn.mergeArray(r,o));const l=[...n.data].map((o,c)=>s.type._parseSync(new _i(n,o,n.path,c)));return wn.mergeArray(r,l)}get element(){return this._def.type}min(t,n){return new ar({...this._def,minLength:{value:t,message:_e.toString(n)}})}max(t,n){return new ar({...this._def,maxLength:{value:t,message:_e.toString(n)}})}length(t,n){return new ar({...this._def,exactLength:{value:t,message:_e.toString(n)}})}nonempty(t){return this.min(1,t)}}ar.create=(e,t)=>new ar({type:e,minLength:null,maxLength:null,exactLength:null,typeName:me.ZodArray,...Pe(t)});function Ja(e){if(e instanceof At){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Rr.create(Ja(r))}return new At({...e._def,shape:()=>t})}else return e instanceof ar?new ar({...e._def,type:Ja(e.element)}):e instanceof Rr?Rr.create(Ja(e.unwrap())):e instanceof cs?cs.create(Ja(e.unwrap())):e instanceof ra?ra.create(e.items.map(t=>Ja(t))):e}class At extends Ze{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Xe.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==we.object){const d=this._getOrReturnCtx(t);return ve(d,{code:ge.invalid_type,expected:we.object,received:d.parsedType}),De}const{status:r,ctx:s}=this._processInputParams(t),{shape:l,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof Si&&this._def.unknownKeys==="strip"))for(const d in s.data)o.includes(d)||c.push(d);const f=[];for(const d of o){const p=l[d],g=s.data[d];f.push({key:{status:"valid",value:d},value:p._parse(new _i(s,g,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof Si){const d=this._def.unknownKeys;if(d==="passthrough")for(const p of c)f.push({key:{status:"valid",value:p},value:{status:"valid",value:s.data[p]}});else if(d==="strict")c.length>0&&(ve(s,{code:ge.unrecognized_keys,keys:c}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const p of c){const g=s.data[p];f.push({key:{status:"valid",value:p},value:d._parse(new _i(s,g,s.path,p)),alwaysSet:p in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const p of f){const g=await p.key,m=await p.value;d.push({key:g,value:m,alwaysSet:p.alwaysSet})}return d}).then(d=>wn.mergeObjectSync(r,d)):wn.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(t){return _e.errToObj,new At({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var l,o;const s=((o=(l=this._def).errorMap)==null?void 0:o.call(l,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:_e.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new At({...this._def,unknownKeys:"strip"})}passthrough(){return new At({...this._def,unknownKeys:"passthrough"})}extend(t){return new At({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new At({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:me.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new At({...this._def,catchall:t})}pick(t){const n={};for(const r of Xe.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new At({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Xe.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new At({...this._def,shape:()=>n})}deepPartial(){return Ja(this)}partial(t){const n={};for(const r of Xe.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new At({...this._def,shape:()=>n})}required(t){const n={};for(const r of Xe.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let l=this.shape[r];for(;l instanceof Rr;)l=l._def.innerType;n[r]=l}return new At({...this._def,shape:()=>n})}keyof(){return C_(Xe.objectKeys(this.shape))}}At.create=(e,t)=>new At({shape:()=>e,unknownKeys:"strip",catchall:Si.create(),typeName:me.ZodObject,...Pe(t)});At.strictCreate=(e,t)=>new At({shape:()=>e,unknownKeys:"strict",catchall:Si.create(),typeName:me.ZodObject,...Pe(t)});At.lazycreate=(e,t)=>new At({shape:e,unknownKeys:"strip",catchall:Si.create(),typeName:me.ZodObject,...Pe(t)});class pc extends Ze{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(l){for(const c of l)if(c.result.status==="valid")return c.result;for(const c of l)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;const o=l.map(c=>new jr(c.ctx.common.issues));return ve(n,{code:ge.invalid_union,unionErrors:o}),De}if(n.common.async)return Promise.all(r.map(async l=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let l;const o=[];for(const f of r){const d={...n,common:{...n.common,issues:[]},parent:null},p=f._parseSync({data:n.data,path:n.path,parent:d});if(p.status==="valid")return p;p.status==="dirty"&&!l&&(l={result:p,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const c=o.map(f=>new jr(f));return ve(n,{code:ge.invalid_union,unionErrors:c}),De}}get options(){return this._def.options}}pc.create=(e,t)=>new pc({options:e,typeName:me.ZodUnion,...Pe(t)});function bg(e,t){const n=mi(e),r=mi(t);if(e===t)return{valid:!0,data:e};if(n===we.object&&r===we.object){const s=Xe.objectKeys(t),l=Xe.objectKeys(e).filter(c=>s.indexOf(c)!==-1),o={...e,...t};for(const c of l){const f=bg(e[c],t[c]);if(!f.valid)return{valid:!1};o[c]=f.data}return{valid:!0,data:o}}else if(n===we.array&&r===we.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let l=0;l<e.length;l++){const o=e[l],c=t[l],f=bg(o,c);if(!f.valid)return{valid:!1};s.push(f.data)}return{valid:!0,data:s}}else return n===we.date&&r===we.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class gc extends Ze{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(l,o)=>{if($v(l)||$v(o))return De;const c=bg(l.value,o.value);return c.valid?((Vv(l)||Vv(o))&&n.dirty(),{status:n.value,value:c.data}):(ve(r,{code:ge.invalid_intersection_types}),De)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([l,o])=>s(l,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}gc.create=(e,t,n)=>new gc({left:e,right:t,typeName:me.ZodIntersection,...Pe(n)});class ra extends Ze{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==we.array)return ve(r,{code:ge.invalid_type,expected:we.array,received:r.parsedType}),De;if(r.data.length<this._def.items.length)return ve(r,{code:ge.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),De;!this._def.rest&&r.data.length>this._def.items.length&&(ve(r,{code:ge.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...r.data].map((o,c)=>{const f=this._def.items[c]||this._def.rest;return f?f._parse(new _i(r,o,r.path,c)):null}).filter(o=>!!o);return r.common.async?Promise.all(l).then(o=>wn.mergeArray(n,o)):wn.mergeArray(n,l)}get items(){return this._def.items}rest(t){return new ra({...this._def,rest:t})}}ra.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ra({items:e,typeName:me.ZodTuple,rest:null,...Pe(t)})};class Jv extends Ze{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==we.map)return ve(r,{code:ge.invalid_type,expected:we.map,received:r.parsedType}),De;const s=this._def.keyType,l=this._def.valueType,o=[...r.data.entries()].map(([c,f],d)=>({key:s._parse(new _i(r,c,r.path,[d,"key"])),value:l._parse(new _i(r,f,r.path,[d,"value"]))}));if(r.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const f of o){const d=await f.key,p=await f.value;if(d.status==="aborted"||p.status==="aborted")return De;(d.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(d.value,p.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const f of o){const d=f.key,p=f.value;if(d.status==="aborted"||p.status==="aborted")return De;(d.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(d.value,p.value)}return{status:n.value,value:c}}}}Jv.create=(e,t,n)=>new Jv({valueType:t,keyType:e,typeName:me.ZodMap,...Pe(n)});class Zl extends Ze{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==we.set)return ve(r,{code:ge.invalid_type,expected:we.set,received:r.parsedType}),De;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(ve(r,{code:ge.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(ve(r,{code:ge.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function o(f){const d=new Set;for(const p of f){if(p.status==="aborted")return De;p.status==="dirty"&&n.dirty(),d.add(p.value)}return{status:n.value,value:d}}const c=[...r.data.values()].map((f,d)=>l._parse(new _i(r,f,r.path,d)));return r.common.async?Promise.all(c).then(f=>o(f)):o(c)}min(t,n){return new Zl({...this._def,minSize:{value:t,message:_e.toString(n)}})}max(t,n){return new Zl({...this._def,maxSize:{value:t,message:_e.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Zl.create=(e,t)=>new Zl({valueType:e,minSize:null,maxSize:null,typeName:me.ZodSet,...Pe(t)});class Wv extends Ze{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Wv.create=(e,t)=>new Wv({getter:e,typeName:me.ZodLazy,...Pe(t)});class ex extends Ze{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ve(n,{received:n.data,code:ge.invalid_literal,expected:this._def.value}),De}return{status:"valid",value:t.data}}get value(){return this._def.value}}ex.create=(e,t)=>new ex({value:e,typeName:me.ZodLiteral,...Pe(t)});function C_(e,t){return new os({values:e,typeName:me.ZodEnum,...Pe(t)})}class os extends Ze{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ve(n,{expected:Xe.joinValues(r),received:n.parsedType,code:ge.invalid_type}),De}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return ve(n,{received:n.data,code:ge.invalid_enum_value,options:r}),De}return Rn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return os.create(t,{...this._def,...n})}exclude(t,n=this._def){return os.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}os.create=C_;class tx extends Ze{_parse(t){const n=Xe.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==we.string&&r.parsedType!==we.number){const s=Xe.objectValues(n);return ve(r,{expected:Xe.joinValues(s),received:r.parsedType,code:ge.invalid_type}),De}if(this._cache||(this._cache=new Set(Xe.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=Xe.objectValues(n);return ve(r,{received:r.data,code:ge.invalid_enum_value,options:s}),De}return Rn(t.data)}get enum(){return this._def.values}}tx.create=(e,t)=>new tx({values:e,typeName:me.ZodNativeEnum,...Pe(t)});class mc extends Ze{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==we.promise&&n.common.async===!1)return ve(n,{code:ge.invalid_type,expected:we.promise,received:n.parsedType}),De;const r=n.parsedType===we.promise?n.data:Promise.resolve(n.data);return Rn(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}mc.create=(e,t)=>new mc({type:e,typeName:me.ZodPromise,...Pe(t)});class us extends Ze{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===me.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,l={addIssue:o=>{ve(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const o=s.transform(r.data,l);if(r.common.async)return Promise.resolve(o).then(async c=>{if(n.value==="aborted")return De;const f=await this._def.schema._parseAsync({data:c,path:r.path,parent:r});return f.status==="aborted"?De:f.status==="dirty"||n.value==="dirty"?Ll(f.value):f});{if(n.value==="aborted")return De;const c=this._def.schema._parseSync({data:o,path:r.path,parent:r});return c.status==="aborted"?De:c.status==="dirty"||n.value==="dirty"?Ll(c.value):c}}if(s.type==="refinement"){const o=c=>{const f=s.refinement(c,l);if(r.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?De:(c.status==="dirty"&&n.dirty(),o(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?De:(c.status==="dirty"&&n.dirty(),o(c.value).then(()=>({status:n.value,value:c.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ss(o))return De;const c=s.transform(o.value,l);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>ss(o)?Promise.resolve(s.transform(o.value,l)).then(c=>({status:n.value,value:c})):De);Xe.assertNever(s)}}us.create=(e,t,n)=>new us({schema:e,typeName:me.ZodEffects,effect:t,...Pe(n)});us.createWithPreprocess=(e,t,n)=>new us({schema:t,effect:{type:"preprocess",transform:e},typeName:me.ZodEffects,...Pe(n)});class Rr extends Ze{_parse(t){return this._getType(t)===we.undefined?Rn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Rr.create=(e,t)=>new Rr({innerType:e,typeName:me.ZodOptional,...Pe(t)});class cs extends Ze{_parse(t){return this._getType(t)===we.null?Rn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}cs.create=(e,t)=>new cs({innerType:e,typeName:me.ZodNullable,...Pe(t)});class vg extends Ze{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===we.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}vg.create=(e,t)=>new vg({innerType:e,typeName:me.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Pe(t)});class xg extends Ze{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return dc(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new jr(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new jr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}xg.create=(e,t)=>new xg({innerType:e,typeName:me.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Pe(t)});class nx extends Ze{_parse(t){if(this._getType(t)!==we.nan){const r=this._getOrReturnCtx(t);return ve(r,{code:ge.invalid_type,expected:we.nan,received:r.parsedType}),De}return{status:"valid",value:t.data}}}nx.create=e=>new nx({typeName:me.ZodNaN,...Pe(e)});class FC extends Ze{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class im extends Ze{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?De:l.status==="dirty"?(n.dirty(),Ll(l.value)):this._def.out._parseAsync({data:l.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?De:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new im({in:t,out:n,typeName:me.ZodPipeline})}}class wg extends Ze{_parse(t){const n=this._def.innerType._parse(t),r=s=>(ss(s)&&(s.value=Object.freeze(s.value)),s);return dc(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}wg.create=(e,t)=>new wg({innerType:e,typeName:me.ZodReadonly,...Pe(t)});var me;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(me||(me={}));const PC=vi.create,UC=ls.create,HC=yg.create;Si.create;const $C=ar.create,ic=At.create;pc.create;gc.create;ra.create;os.create;mc.create;Rr.create;cs.create;function VC(e){let t={};for(let r of e||[])t[r.name]=N_(r);let n=[];for(let r of e||[])r.required!==!1&&n.push(r.name);return{type:"object",properties:t,required:n}}function N_(e){var t,n,r;switch(e.type){case"string":return{type:"string",description:e.description,...e.enum&&{enum:e.enum}};case"number":case"boolean":return{type:e.type,description:e.description};case"object":case"object[]":const s=(t=e.attributes)==null?void 0:t.reduce((o,c)=>(o[c.name]=N_(c),o),{}),l=(n=e.attributes)==null?void 0:n.filter(o=>o.required!==!1).map(o=>o.name);return e.type==="object[]"?{type:"array",items:{type:"object",...s&&{properties:s},...l&&l.length>0&&{required:l}},description:e.description}:{type:"object",description:e.description,...s&&{properties:s},...l&&l.length>0&&{required:l}};default:return(r=e.type)!=null&&r.endsWith("[]")?{type:"array",items:{type:e.type.slice(0,-2)},description:e.description}:{type:"string",description:e.description}}}function qC(e){const t={};for(const[n,r]of Object.entries(e.properties))t[n]=_g(r,e.required?e.required.includes(n):!1);return t}function _g(e,t){if(e.type==="object"){const n={};if(!e.properties||!Object.keys(e.properties).length)return t?ic(n):ic(n).optional();for(const[s,l]of Object.entries(e.properties))n[s]=_g(l,e.required?e.required.includes(s):!1);let r=ic(n).describe(e.description);return t?r:r.optional()}else if(e.type==="string"){let n=PC().describe(e.description);return t?n:n.optional()}else if(e.type==="number"){let n=UC().describe(e.description);return t?n:n.optional()}else if(e.type==="boolean"){let n=HC().describe(e.description);return t?n:n.optional()}else if(e.type==="array"){let n=_g(e.items,!0),r=$C(n).describe(e.description);return t?r:r.optional()}throw new Error("Invalid JSON schema")}const GC=Symbol("Let zodToJsonSchema decide on which parser to use"),ZC={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},YC=e=>({...ZC,...e}),XC=e=>{const t=YC(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([r,s])=>[s._def,{def:s._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}};function O_(e,t,n,r){r!=null&&r.errorMessages&&n&&(e.errorMessage={...e.errorMessage,[t]:n})}function tt(e,t,n,r,s){e[t]=n,O_(e,t,r,s)}function QC(){return{}}function KC(e,t){var r,s,l;const n={type:"array"};return(r=e.type)!=null&&r._def&&((l=(s=e.type)==null?void 0:s._def)==null?void 0:l.typeName)!==me.ZodAny&&(n.items=Je(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&tt(n,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&tt(n,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(tt(n,"minItems",e.exactLength.value,e.exactLength.message,t),tt(n,"maxItems",e.exactLength.value,e.exactLength.message,t)),n}function JC(e,t){const n={type:"integer",format:"int64"};if(!e.checks)return n;for(const r of e.checks)switch(r.kind){case"min":t.target==="jsonSchema7"?r.inclusive?tt(n,"minimum",r.value,r.message,t):tt(n,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(n.exclusiveMinimum=!0),tt(n,"minimum",r.value,r.message,t));break;case"max":t.target==="jsonSchema7"?r.inclusive?tt(n,"maximum",r.value,r.message,t):tt(n,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(n.exclusiveMaximum=!0),tt(n,"maximum",r.value,r.message,t));break;case"multipleOf":tt(n,"multipleOf",r.value,r.message,t);break}return n}function WC(){return{type:"boolean"}}function M_(e,t){return Je(e.type._def,t)}const eN=(e,t)=>Je(e.innerType._def,t);function R_(e,t,n){const r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((s,l)=>R_(e,t,s))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return tN(e,t)}}const tN=(e,t)=>{const n={type:"integer",format:"unix-time"};if(t.target==="openApi3")return n;for(const r of e.checks)switch(r.kind){case"min":tt(n,"minimum",r.value,r.message,t);break;case"max":tt(n,"maximum",r.value,r.message,t);break}return n};function nN(e,t){return{...Je(e.innerType._def,t),default:e.defaultValue()}}function rN(e,t){return t.effectStrategy==="input"?Je(e.schema._def,t):{}}function iN(e){return{type:"string",enum:Array.from(e.values)}}const aN=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function sN(e,t){const n=[Je(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),Je(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(l=>!!l);let r=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0;const s=[];return n.forEach(l=>{if(aN(l))s.push(...l.allOf),l.unevaluatedProperties===void 0&&(r=void 0);else{let o=l;if("additionalProperties"in l&&l.additionalProperties===!1){const{additionalProperties:c,...f}=l;o=f}else r=void 0;s.push(o)}}),s.length?{allOf:s,...r}:void 0}function lN(e,t){const n=typeof e.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[e.value]}:{type:n==="bigint"?"integer":n,const:e.value}}let jh;const Fn={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(jh===void 0&&(jh=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),jh),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function D_(e,t){const n={type:"string"};if(e.checks)for(const r of e.checks)switch(r.kind){case"min":tt(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,r.message,t);break;case"max":tt(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case"email":switch(t.emailStrategy){case"format:email":Pn(n,"email",r.message,t);break;case"format:idn-email":Pn(n,"idn-email",r.message,t);break;case"pattern:zod":Xt(n,Fn.email,r.message,t);break}break;case"url":Pn(n,"uri",r.message,t);break;case"uuid":Pn(n,"uuid",r.message,t);break;case"regex":Xt(n,r.regex,r.message,t);break;case"cuid":Xt(n,Fn.cuid,r.message,t);break;case"cuid2":Xt(n,Fn.cuid2,r.message,t);break;case"startsWith":Xt(n,RegExp(`^${zh(r.value,t)}`),r.message,t);break;case"endsWith":Xt(n,RegExp(`${zh(r.value,t)}$`),r.message,t);break;case"datetime":Pn(n,"date-time",r.message,t);break;case"date":Pn(n,"date",r.message,t);break;case"time":Pn(n,"time",r.message,t);break;case"duration":Pn(n,"duration",r.message,t);break;case"length":tt(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,r.message,t),tt(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case"includes":{Xt(n,RegExp(zh(r.value,t)),r.message,t);break}case"ip":{r.version!=="v6"&&Pn(n,"ipv4",r.message,t),r.version!=="v4"&&Pn(n,"ipv6",r.message,t);break}case"base64url":Xt(n,Fn.base64url,r.message,t);break;case"jwt":Xt(n,Fn.jwt,r.message,t);break;case"cidr":{r.version!=="v6"&&Xt(n,Fn.ipv4Cidr,r.message,t),r.version!=="v4"&&Xt(n,Fn.ipv6Cidr,r.message,t);break}case"emoji":Xt(n,Fn.emoji(),r.message,t);break;case"ulid":{Xt(n,Fn.ulid,r.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Pn(n,"binary",r.message,t);break}case"contentEncoding:base64":{tt(n,"contentEncoding","base64",r.message,t);break}case"pattern:zod":{Xt(n,Fn.base64,r.message,t);break}}break}case"nanoid":Xt(n,Fn.nanoid,r.message,t)}return n}function zh(e,t){return t.patternStrategy==="escape"?uN(e):e}const oN=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function uN(e){let t="";for(let n=0;n<e.length;n++)oN.has(e[n])||(t+="\\"),t+=e[n];return t}function Pn(e,t,n,r){var s;e.format||(s=e.anyOf)!=null&&s.some(l=>l.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&r.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):tt(e,"format",t,n,r)}function Xt(e,t,n,r){var s;e.pattern||(s=e.allOf)!=null&&s.some(l=>l.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&r.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:rx(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):tt(e,"pattern",rx(t,r),n,r)}function rx(e,t){var f;if(!t.applyRegexFlags||!e.flags)return e.source;const n={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},r=n.i?e.source.toLowerCase():e.source;let s="",l=!1,o=!1,c=!1;for(let d=0;d<r.length;d++){if(l){s+=r[d],l=!1;continue}if(n.i){if(o){if(r[d].match(/[a-z]/)){c?(s+=r[d],s+=`${r[d-2]}-${r[d]}`.toUpperCase(),c=!1):r[d+1]==="-"&&((f=r[d+2])!=null&&f.match(/[a-z]/))?(s+=r[d],c=!0):s+=`${r[d]}${r[d].toUpperCase()}`;continue}}else if(r[d].match(/[a-z]/)){s+=`[${r[d]}${r[d].toUpperCase()}]`;continue}}if(n.m){if(r[d]==="^"){s+=`(^|(?<=[\r
|
|
48
|
+
`+u.stack}}function Jt(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function No(i){var a=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function fa(i){var a=No(i)?"checked":"value",u=Object.getOwnPropertyDescriptor(i.constructor.prototype,a),h=""+i[a];if(!i.hasOwnProperty(a)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var y=u.get,v=u.set;return Object.defineProperty(i,a,{configurable:!0,get:function(){return y.call(this)},set:function(C){h=""+C,v.call(this,C)}}),Object.defineProperty(i,a,{enumerable:u.enumerable}),{getValue:function(){return h},setValue:function(C){h=""+C},stopTracking:function(){i._valueTracker=null,delete i[a]}}}}function da(i){i._valueTracker||(i._valueTracker=fa(i))}function Co(i){if(!i)return!1;var a=i._valueTracker;if(!a)return!0;var u=a.getValue(),h="";return i&&(h=No(i)?i.checked?"true":"false":i.value),i=h,i!==u?(a.setValue(i),!0):!1}function $r(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var gf=/[\n"\\]/g;function Wt(i){return i.replace(gf,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function ha(i,a,u,h,y,v,C,z){i.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?i.type=C:i.removeAttribute("type"),a!=null?C==="number"?(a===0&&i.value===""||i.value!=a)&&(i.value=""+Jt(a)):i.value!==""+Jt(a)&&(i.value=""+Jt(a)):C!=="submit"&&C!=="reset"||i.removeAttribute("value"),a!=null?mf(i,C,Jt(a)):u!=null?mf(i,C,Jt(u)):h!=null&&i.removeAttribute("value"),y==null&&v!=null&&(i.defaultChecked=!!v),y!=null&&(i.checked=y&&typeof y!="function"&&typeof y!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?i.name=""+Jt(z):i.removeAttribute("name")}function Vm(i,a,u,h,y,v,C,z){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(i.type=v),a!=null||u!=null){if(!(v!=="submit"&&v!=="reset"||a!=null))return;u=u!=null?""+Jt(u):"",a=a!=null?""+Jt(a):u,z||a===i.value||(i.value=a),i.defaultValue=a}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,i.checked=z?i.checked:!!h,i.defaultChecked=!!h,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(i.name=C)}function mf(i,a,u){a==="number"&&$r(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function pa(i,a,u,h){if(i=i.options,a){a={};for(var y=0;y<u.length;y++)a["$"+u[y]]=!0;for(u=0;u<i.length;u++)y=a.hasOwnProperty("$"+i[u].value),i[u].selected!==y&&(i[u].selected=y),y&&h&&(i[u].defaultSelected=!0)}else{for(u=""+Jt(u),a=null,y=0;y<i.length;y++){if(i[y].value===u){i[y].selected=!0,h&&(i[y].defaultSelected=!0);return}a!==null||i[y].disabled||(a=i[y])}a!==null&&(a.selected=!0)}}function qm(i,a,u){if(a!=null&&(a=""+Jt(a),a!==i.value&&(i.value=a),u==null)){i.defaultValue!==a&&(i.defaultValue=a);return}i.defaultValue=u!=null?""+Jt(u):""}function Gm(i,a,u,h){if(a==null){if(h!=null){if(u!=null)throw Error(r(92));if($(h)){if(1<h.length)throw Error(r(93));h=h[0]}u=h}u==null&&(u=""),a=u}u=Jt(a),i.defaultValue=u,h=i.textContent,h===u&&h!==""&&h!==null&&(i.value=h)}function ga(i,a){if(a){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=a;return}}i.textContent=a}var b2=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Zm(i,a,u){var h=a.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?i.setProperty(a,""):a==="float"?i.cssFloat="":i[a]="":h?i.setProperty(a,u):typeof u!="number"||u===0||b2.has(a)?a==="float"?i.cssFloat=u:i[a]=(""+u).trim():i[a]=u+"px"}function Ym(i,a,u){if(a!=null&&typeof a!="object")throw Error(r(62));if(i=i.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||a!=null&&a.hasOwnProperty(h)||(h.indexOf("--")===0?i.setProperty(h,""):h==="float"?i.cssFloat="":i[h]="");for(var y in a)h=a[y],a.hasOwnProperty(y)&&u[y]!==h&&Zm(i,y,h)}else for(var v in a)a.hasOwnProperty(v)&&Zm(i,v,a[v])}function yf(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var v2=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),x2=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Oo(i){return x2.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}var bf=null;function vf(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var ma=null,ya=null;function Xm(i){var a=pr(i);if(a&&(i=a.stateNode)){var u=i[Ut]||null;e:switch(i=a.stateNode,a.type){case"input":if(ha(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),a=u.name,u.type==="radio"&&a!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Wt(""+a)+'"][type="radio"]'),a=0;a<u.length;a++){var h=u[a];if(h!==i&&h.form===i.form){var y=h[Ut]||null;if(!y)throw Error(r(90));ha(h,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(a=0;a<u.length;a++)h=u[a],h.form===i.form&&Co(h)}break e;case"textarea":qm(i,u.value,u.defaultValue);break e;case"select":a=u.value,a!=null&&pa(i,!!u.multiple,a,!1)}}}var xf=!1;function Qm(i,a,u){if(xf)return i(a,u);xf=!0;try{var h=i(a);return h}finally{if(xf=!1,(ma!==null||ya!==null)&&(gu(),ma&&(a=ma,i=ya,ya=ma=null,Xm(a),i)))for(a=0;a<i.length;a++)Xm(i[a])}}function Rs(i,a){var u=i.stateNode;if(u===null)return null;var h=u[Ut]||null;if(h===null)return null;u=h[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(i=i.type,h=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!h;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(r(231,a,typeof u));return u}var mr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wf=!1;if(mr)try{var Ds={};Object.defineProperty(Ds,"passive",{get:function(){wf=!0}}),window.addEventListener("test",Ds,Ds),window.removeEventListener("test",Ds,Ds)}catch{wf=!1}var Vr=null,_f=null,Mo=null;function Km(){if(Mo)return Mo;var i,a=_f,u=a.length,h,y="value"in Vr?Vr.value:Vr.textContent,v=y.length;for(i=0;i<u&&a[i]===y[i];i++);var C=u-i;for(h=1;h<=C&&a[u-h]===y[v-h];h++);return Mo=y.slice(i,1<h?1-h:void 0)}function Ro(i){var a=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&a===13&&(i=13)):i=a,i===10&&(i=13),32<=i||i===13?i:0}function Do(){return!0}function Jm(){return!1}function en(i){function a(u,h,y,v,C){this._reactName=u,this._targetInst=y,this.type=h,this.nativeEvent=v,this.target=C,this.currentTarget=null;for(var z in i)i.hasOwnProperty(z)&&(u=i[z],this[z]=u?u(v):v[z]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Do:Jm,this.isPropagationStopped=Jm,this}return p(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Do)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Do)},persist:function(){},isPersistent:Do}),a}var Oi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jo=en(Oi),js=p({},Oi,{view:0,detail:0}),w2=en(js),Sf,kf,zs,zo=p({},js,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Af,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==zs&&(zs&&i.type==="mousemove"?(Sf=i.screenX-zs.screenX,kf=i.screenY-zs.screenY):kf=Sf=0,zs=i),Sf)},movementY:function(i){return"movementY"in i?i.movementY:kf}}),Wm=en(zo),_2=p({},zo,{dataTransfer:0}),S2=en(_2),k2=p({},js,{relatedTarget:0}),Ef=en(k2),E2=p({},Oi,{animationName:0,elapsedTime:0,pseudoElement:0}),A2=en(E2),T2=p({},Oi,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),N2=en(T2),C2=p({},Oi,{data:0}),ey=en(C2),O2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},M2={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},R2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function D2(i){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(i):(i=R2[i])?!!a[i]:!1}function Af(){return D2}var j2=p({},js,{key:function(i){if(i.key){var a=O2[i.key]||i.key;if(a!=="Unidentified")return a}return i.type==="keypress"?(i=Ro(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?M2[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Af,charCode:function(i){return i.type==="keypress"?Ro(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Ro(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),z2=en(j2),L2=p({},zo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ty=en(L2),I2=p({},js,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Af}),B2=en(I2),F2=p({},Oi,{propertyName:0,elapsedTime:0,pseudoElement:0}),P2=en(F2),U2=p({},zo,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),H2=en(U2),$2=p({},Oi,{newState:0,oldState:0}),V2=en($2),q2=[9,13,27,32],Tf=mr&&"CompositionEvent"in window,Ls=null;mr&&"documentMode"in document&&(Ls=document.documentMode);var G2=mr&&"TextEvent"in window&&!Ls,ny=mr&&(!Tf||Ls&&8<Ls&&11>=Ls),ry=" ",iy=!1;function ay(i,a){switch(i){case"keyup":return q2.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sy(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var ba=!1;function Z2(i,a){switch(i){case"compositionend":return sy(a);case"keypress":return a.which!==32?null:(iy=!0,ry);case"textInput":return i=a.data,i===ry&&iy?null:i;default:return null}}function Y2(i,a){if(ba)return i==="compositionend"||!Tf&&ay(i,a)?(i=Km(),Mo=_f=Vr=null,ba=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return ny&&a.locale!=="ko"?null:a.data;default:return null}}var X2={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ly(i){var a=i&&i.nodeName&&i.nodeName.toLowerCase();return a==="input"?!!X2[i.type]:a==="textarea"}function oy(i,a,u,h){ma?ya?ya.push(h):ya=[h]:ma=h,a=wu(a,"onChange"),0<a.length&&(u=new jo("onChange","change",null,u,h),i.push({event:u,listeners:a}))}var Is=null,Bs=null;function Q2(i){Hb(i,0)}function Lo(i){var a=Fr(i);if(Co(a))return i}function uy(i,a){if(i==="change")return a}var cy=!1;if(mr){var Nf;if(mr){var Cf="oninput"in document;if(!Cf){var fy=document.createElement("div");fy.setAttribute("oninput","return;"),Cf=typeof fy.oninput=="function"}Nf=Cf}else Nf=!1;cy=Nf&&(!document.documentMode||9<document.documentMode)}function dy(){Is&&(Is.detachEvent("onpropertychange",hy),Bs=Is=null)}function hy(i){if(i.propertyName==="value"&&Lo(Bs)){var a=[];oy(a,Bs,i,vf(i)),Qm(Q2,a)}}function K2(i,a,u){i==="focusin"?(dy(),Is=a,Bs=u,Is.attachEvent("onpropertychange",hy)):i==="focusout"&&dy()}function J2(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Lo(Bs)}function W2(i,a){if(i==="click")return Lo(a)}function eA(i,a){if(i==="input"||i==="change")return Lo(a)}function tA(i,a){return i===a&&(i!==0||1/i===1/a)||i!==i&&a!==a}var cn=typeof Object.is=="function"?Object.is:tA;function Fs(i,a){if(cn(i,a))return!0;if(typeof i!="object"||i===null||typeof a!="object"||a===null)return!1;var u=Object.keys(i),h=Object.keys(a);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var y=u[h];if(!be.call(a,y)||!cn(i[y],a[y]))return!1}return!0}function py(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function gy(i,a){var u=py(i);i=0;for(var h;u;){if(u.nodeType===3){if(h=i+u.textContent.length,i<=a&&h>=a)return{node:u,offset:a-i};i=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=py(u)}}function my(i,a){return i&&a?i===a?!0:i&&i.nodeType===3?!1:a&&a.nodeType===3?my(i,a.parentNode):"contains"in i?i.contains(a):i.compareDocumentPosition?!!(i.compareDocumentPosition(a)&16):!1:!1}function yy(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var a=$r(i.document);a instanceof i.HTMLIFrameElement;){try{var u=typeof a.contentWindow.location.href=="string"}catch{u=!1}if(u)i=a.contentWindow;else break;a=$r(i.document)}return a}function Of(i){var a=i&&i.nodeName&&i.nodeName.toLowerCase();return a&&(a==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||a==="textarea"||i.contentEditable==="true")}var nA=mr&&"documentMode"in document&&11>=document.documentMode,va=null,Mf=null,Ps=null,Rf=!1;function by(i,a,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Rf||va==null||va!==$r(h)||(h=va,"selectionStart"in h&&Of(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Ps&&Fs(Ps,h)||(Ps=h,h=wu(Mf,"onSelect"),0<h.length&&(a=new jo("onSelect","select",null,a,u),i.push({event:a,listeners:h}),a.target=va)))}function Mi(i,a){var u={};return u[i.toLowerCase()]=a.toLowerCase(),u["Webkit"+i]="webkit"+a,u["Moz"+i]="moz"+a,u}var xa={animationend:Mi("Animation","AnimationEnd"),animationiteration:Mi("Animation","AnimationIteration"),animationstart:Mi("Animation","AnimationStart"),transitionrun:Mi("Transition","TransitionRun"),transitionstart:Mi("Transition","TransitionStart"),transitioncancel:Mi("Transition","TransitionCancel"),transitionend:Mi("Transition","TransitionEnd")},Df={},vy={};mr&&(vy=document.createElement("div").style,"AnimationEvent"in window||(delete xa.animationend.animation,delete xa.animationiteration.animation,delete xa.animationstart.animation),"TransitionEvent"in window||delete xa.transitionend.transition);function Ri(i){if(Df[i])return Df[i];if(!xa[i])return i;var a=xa[i],u;for(u in a)if(a.hasOwnProperty(u)&&u in vy)return Df[i]=a[u];return i}var xy=Ri("animationend"),wy=Ri("animationiteration"),_y=Ri("animationstart"),rA=Ri("transitionrun"),iA=Ri("transitionstart"),aA=Ri("transitioncancel"),Sy=Ri("transitionend"),ky=new Map,jf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");jf.push("scrollEnd");function Ln(i,a){ky.set(i,a),gr(a,[i])}var Ey=new WeakMap;function kn(i,a){if(typeof i=="object"&&i!==null){var u=Ey.get(i);return u!==void 0?u:(a={value:i,source:a,stack:To(a)},Ey.set(i,a),a)}return{value:i,source:a,stack:To(a)}}var En=[],wa=0,zf=0;function Io(){for(var i=wa,a=zf=wa=0;a<i;){var u=En[a];En[a++]=null;var h=En[a];En[a++]=null;var y=En[a];En[a++]=null;var v=En[a];if(En[a++]=null,h!==null&&y!==null){var C=h.pending;C===null?y.next=y:(y.next=C.next,C.next=y),h.pending=y}v!==0&&Ay(u,y,v)}}function Bo(i,a,u,h){En[wa++]=i,En[wa++]=a,En[wa++]=u,En[wa++]=h,zf|=h,i.lanes|=h,i=i.alternate,i!==null&&(i.lanes|=h)}function Lf(i,a,u,h){return Bo(i,a,u,h),Fo(i)}function _a(i,a){return Bo(i,null,null,a),Fo(i)}function Ay(i,a,u){i.lanes|=u;var h=i.alternate;h!==null&&(h.lanes|=u);for(var y=!1,v=i.return;v!==null;)v.childLanes|=u,h=v.alternate,h!==null&&(h.childLanes|=u),v.tag===22&&(i=v.stateNode,i===null||i._visibility&1||(y=!0)),i=v,v=v.return;return i.tag===3?(v=i.stateNode,y&&a!==null&&(y=31-Te(u),i=v.hiddenUpdates,h=i[y],h===null?i[y]=[a]:h.push(a),a.lane=u|536870912),v):null}function Fo(i){if(50<fl)throw fl=0,Hd=null,Error(r(185));for(var a=i.return;a!==null;)i=a,a=i.return;return i.tag===3?i.stateNode:null}var Sa={};function sA(i,a,u,h){this.tag=i,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fn(i,a,u,h){return new sA(i,a,u,h)}function If(i){return i=i.prototype,!(!i||!i.isReactComponent)}function yr(i,a){var u=i.alternate;return u===null?(u=fn(i.tag,a,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=a,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,a=i.dependencies,u.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function Ty(i,a){i.flags&=65011714;var u=i.alternate;return u===null?(i.childLanes=0,i.lanes=a,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,a=u.dependencies,i.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),i}function Po(i,a,u,h,y,v){var C=0;if(h=i,typeof i=="function")If(i)&&(C=1);else if(typeof i=="string")C=oT(i,u,V.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case U:return i=fn(31,u,a,y),i.elementType=U,i.lanes=v,i;case x:return Di(u.children,y,v,a);case w:C=8,y|=24;break;case _:return i=fn(12,u,a,y|2),i.elementType=_,i.lanes=v,i;case D:return i=fn(13,u,a,y),i.elementType=D,i.lanes=v,i;case M:return i=fn(19,u,a,y),i.elementType=M,i.lanes=v,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case k:case S:C=10;break e;case A:C=9;break e;case O:C=11;break e;case F:C=14;break e;case L:C=16,h=null;break e}C=29,u=Error(r(130,i===null?"null":typeof i,"")),h=null}return a=fn(C,u,a,y),a.elementType=i,a.type=h,a.lanes=v,a}function Di(i,a,u,h){return i=fn(7,i,h,a),i.lanes=u,i}function Bf(i,a,u){return i=fn(6,i,null,a),i.lanes=u,i}function Ff(i,a,u){return a=fn(4,i.children!==null?i.children:[],i.key,a),a.lanes=u,a.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},a}var ka=[],Ea=0,Uo=null,Ho=0,An=[],Tn=0,ji=null,br=1,vr="";function zi(i,a){ka[Ea++]=Ho,ka[Ea++]=Uo,Uo=i,Ho=a}function Ny(i,a,u){An[Tn++]=br,An[Tn++]=vr,An[Tn++]=ji,ji=i;var h=br;i=vr;var y=32-Te(h)-1;h&=~(1<<y),u+=1;var v=32-Te(a)+y;if(30<v){var C=y-y%5;v=(h&(1<<C)-1).toString(32),h>>=C,y-=C,br=1<<32-Te(a)+y|u<<y|h,vr=v+i}else br=1<<v|u<<y|h,vr=i}function Pf(i){i.return!==null&&(zi(i,1),Ny(i,1,0))}function Uf(i){for(;i===Uo;)Uo=ka[--Ea],ka[Ea]=null,Ho=ka[--Ea],ka[Ea]=null;for(;i===ji;)ji=An[--Tn],An[Tn]=null,vr=An[--Tn],An[Tn]=null,br=An[--Tn],An[Tn]=null}var Yt=null,gt=null,Ke=!1,Li=null,Wn=!1,Hf=Error(r(519));function Ii(i){var a=Error(r(418,""));throw $s(kn(a,i)),Hf}function Cy(i){var a=i.stateNode,u=i.type,h=i.memoizedProps;switch(a[Mt]=i,a[Ut]=h,u){case"dialog":He("cancel",a),He("close",a);break;case"iframe":case"object":case"embed":He("load",a);break;case"video":case"audio":for(u=0;u<hl.length;u++)He(hl[u],a);break;case"source":He("error",a);break;case"img":case"image":case"link":He("error",a),He("load",a);break;case"details":He("toggle",a);break;case"input":He("invalid",a),Vm(a,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0),da(a);break;case"select":He("invalid",a);break;case"textarea":He("invalid",a),Gm(a,h.value,h.defaultValue,h.children),da(a)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||a.textContent===""+u||h.suppressHydrationWarning===!0||Gb(a.textContent,u)?(h.popover!=null&&(He("beforetoggle",a),He("toggle",a)),h.onScroll!=null&&He("scroll",a),h.onScrollEnd!=null&&He("scrollend",a),h.onClick!=null&&(a.onclick=_u),a=!0):a=!1,a||Ii(i)}function Oy(i){for(Yt=i.return;Yt;)switch(Yt.tag){case 5:case 13:Wn=!1;return;case 27:case 3:Wn=!0;return;default:Yt=Yt.return}}function Us(i){if(i!==Yt)return!1;if(!Ke)return Oy(i),Ke=!0,!1;var a=i.tag,u;if((u=a!==3&&a!==27)&&((u=a===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||ih(i.type,i.memoizedProps)),u=!u),u&>&&Ii(i),Oy(i),a===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));e:{for(i=i.nextSibling,a=0;i;){if(i.nodeType===8)if(u=i.data,u==="/$"){if(a===0){gt=Bn(i.nextSibling);break e}a--}else u!=="$"&&u!=="$!"&&u!=="$?"||a++;i=i.nextSibling}gt=null}}else a===27?(a=gt,si(i.type)?(i=oh,oh=null,gt=i):gt=a):gt=Yt?Bn(i.stateNode.nextSibling):null;return!0}function Hs(){gt=Yt=null,Ke=!1}function My(){var i=Li;return i!==null&&(rn===null?rn=i:rn.push.apply(rn,i),Li=null),i}function $s(i){Li===null?Li=[i]:Li.push(i)}var $f=G(null),Bi=null,xr=null;function qr(i,a,u){T($f,a._currentValue),a._currentValue=u}function wr(i){i._currentValue=$f.current,te($f)}function Vf(i,a,u){for(;i!==null;){var h=i.alternate;if((i.childLanes&a)!==a?(i.childLanes|=a,h!==null&&(h.childLanes|=a)):h!==null&&(h.childLanes&a)!==a&&(h.childLanes|=a),i===u)break;i=i.return}}function qf(i,a,u,h){var y=i.child;for(y!==null&&(y.return=i);y!==null;){var v=y.dependencies;if(v!==null){var C=y.child;v=v.firstContext;e:for(;v!==null;){var z=v;v=y;for(var Z=0;Z<a.length;Z++)if(z.context===a[Z]){v.lanes|=u,z=v.alternate,z!==null&&(z.lanes|=u),Vf(v.return,u,i),h||(C=null);break e}v=z.next}}else if(y.tag===18){if(C=y.return,C===null)throw Error(r(341));C.lanes|=u,v=C.alternate,v!==null&&(v.lanes|=u),Vf(C,u,i),C=null}else C=y.child;if(C!==null)C.return=y;else for(C=y;C!==null;){if(C===i){C=null;break}if(y=C.sibling,y!==null){y.return=C.return,C=y;break}C=C.return}y=C}}function Vs(i,a,u,h){i=null;for(var y=a,v=!1;y!==null;){if(!v){if((y.flags&524288)!==0)v=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var C=y.alternate;if(C===null)throw Error(r(387));if(C=C.memoizedProps,C!==null){var z=y.type;cn(y.pendingProps.value,C.value)||(i!==null?i.push(z):i=[z])}}else if(y===le.current){if(C=y.alternate,C===null)throw Error(r(387));C.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(i!==null?i.push(vl):i=[vl])}y=y.return}i!==null&&qf(a,i,u,h),a.flags|=262144}function $o(i){for(i=i.firstContext;i!==null;){if(!cn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Fi(i){Bi=i,xr=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Ht(i){return Ry(Bi,i)}function Vo(i,a){return Bi===null&&Fi(i),Ry(i,a)}function Ry(i,a){var u=a._currentValue;if(a={context:a,memoizedValue:u,next:null},xr===null){if(i===null)throw Error(r(308));xr=a,i.dependencies={lanes:0,firstContext:a},i.flags|=524288}else xr=xr.next=a;return u}var lA=typeof AbortController<"u"?AbortController:function(){var i=[],a=this.signal={aborted:!1,addEventListener:function(u,h){i.push(h)}};this.abort=function(){a.aborted=!0,i.forEach(function(u){return u()})}},oA=e.unstable_scheduleCallback,uA=e.unstable_NormalPriority,Ct={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Gf(){return{controller:new lA,data:new Map,refCount:0}}function qs(i){i.refCount--,i.refCount===0&&oA(uA,function(){i.controller.abort()})}var Gs=null,Zf=0,Aa=0,Ta=null;function cA(i,a){if(Gs===null){var u=Gs=[];Zf=0,Aa=Xd(),Ta={status:"pending",value:void 0,then:function(h){u.push(h)}}}return Zf++,a.then(Dy,Dy),a}function Dy(){if(--Zf===0&&Gs!==null){Ta!==null&&(Ta.status="fulfilled");var i=Gs;Gs=null,Aa=0,Ta=null;for(var a=0;a<i.length;a++)(0,i[a])()}}function fA(i,a){var u=[],h={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return i.then(function(){h.status="fulfilled",h.value=a;for(var y=0;y<u.length;y++)(0,u[y])(a)},function(y){for(h.status="rejected",h.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),h}var jy=I.S;I.S=function(i,a){typeof a=="object"&&a!==null&&typeof a.then=="function"&&cA(i,a),jy!==null&&jy(i,a)};var Pi=G(null);function Yf(){var i=Pi.current;return i!==null?i:ot.pooledCache}function qo(i,a){a===null?T(Pi,Pi.current):T(Pi,a.pool)}function zy(){var i=Yf();return i===null?null:{parent:Ct._currentValue,pool:i}}var Zs=Error(r(460)),Ly=Error(r(474)),Go=Error(r(542)),Xf={then:function(){}};function Iy(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Zo(){}function By(i,a,u){switch(u=i[u],u===void 0?i.push(a):u!==a&&(a.then(Zo,Zo),a=u),a.status){case"fulfilled":return a.value;case"rejected":throw i=a.reason,Py(i),i;default:if(typeof a.status=="string")a.then(Zo,Zo);else{if(i=ot,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=a,i.status="pending",i.then(function(h){if(a.status==="pending"){var y=a;y.status="fulfilled",y.value=h}},function(h){if(a.status==="pending"){var y=a;y.status="rejected",y.reason=h}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw i=a.reason,Py(i),i}throw Ys=a,Zs}}var Ys=null;function Fy(){if(Ys===null)throw Error(r(459));var i=Ys;return Ys=null,i}function Py(i){if(i===Zs||i===Go)throw Error(r(483))}var Gr=!1;function Qf(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kf(i,a){i=i.updateQueue,a.updateQueue===i&&(a.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Zr(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Yr(i,a,u){var h=i.updateQueue;if(h===null)return null;if(h=h.shared,(We&2)!==0){var y=h.pending;return y===null?a.next=a:(a.next=y.next,y.next=a),h.pending=a,a=Fo(i),Ay(i,null,u),a}return Bo(i,h,a,u),Fo(i)}function Xs(i,a,u){if(a=a.updateQueue,a!==null&&(a=a.shared,(u&4194048)!==0)){var h=a.lanes;h&=i.pendingLanes,u|=h,a.lanes=u,vo(i,u)}}function Jf(i,a){var u=i.updateQueue,h=i.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var y=null,v=null;if(u=u.firstBaseUpdate,u!==null){do{var C={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};v===null?y=v=C:v=v.next=C,u=u.next}while(u!==null);v===null?y=v=a:v=v.next=a}else y=v=a;u={baseState:h.baseState,firstBaseUpdate:y,lastBaseUpdate:v,shared:h.shared,callbacks:h.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=a:i.next=a,u.lastBaseUpdate=a}var Wf=!1;function Qs(){if(Wf){var i=Ta;if(i!==null)throw i}}function Ks(i,a,u,h){Wf=!1;var y=i.updateQueue;Gr=!1;var v=y.firstBaseUpdate,C=y.lastBaseUpdate,z=y.shared.pending;if(z!==null){y.shared.pending=null;var Z=z,re=Z.next;Z.next=null,C===null?v=re:C.next=re,C=Z;var oe=i.alternate;oe!==null&&(oe=oe.updateQueue,z=oe.lastBaseUpdate,z!==C&&(z===null?oe.firstBaseUpdate=re:z.next=re,oe.lastBaseUpdate=Z))}if(v!==null){var de=y.baseState;C=0,oe=re=Z=null,z=v;do{var ie=z.lane&-536870913,ae=ie!==z.lane;if(ae?(Ve&ie)===ie:(h&ie)===ie){ie!==0&&ie===Aa&&(Wf=!0),oe!==null&&(oe=oe.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var Re=i,Oe=z;ie=a;var it=u;switch(Oe.tag){case 1:if(Re=Oe.payload,typeof Re=="function"){de=Re.call(it,de,ie);break e}de=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=Oe.payload,ie=typeof Re=="function"?Re.call(it,de,ie):Re,ie==null)break e;de=p({},de,ie);break e;case 2:Gr=!0}}ie=z.callback,ie!==null&&(i.flags|=64,ae&&(i.flags|=8192),ae=y.callbacks,ae===null?y.callbacks=[ie]:ae.push(ie))}else ae={lane:ie,tag:z.tag,payload:z.payload,callback:z.callback,next:null},oe===null?(re=oe=ae,Z=de):oe=oe.next=ae,C|=ie;if(z=z.next,z===null){if(z=y.shared.pending,z===null)break;ae=z,z=ae.next,ae.next=null,y.lastBaseUpdate=ae,y.shared.pending=null}}while(!0);oe===null&&(Z=de),y.baseState=Z,y.firstBaseUpdate=re,y.lastBaseUpdate=oe,v===null&&(y.shared.lanes=0),ni|=C,i.lanes=C,i.memoizedState=de}}function Uy(i,a){if(typeof i!="function")throw Error(r(191,i));i.call(a)}function Hy(i,a){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)Uy(u[i],a)}var Na=G(null),Yo=G(0);function $y(i,a){i=Nr,T(Yo,i),T(Na,a),Nr=i|a.baseLanes}function ed(){T(Yo,Nr),T(Na,Na.current)}function td(){Nr=Yo.current,te(Na),te(Yo)}var Xr=0,Be=null,nt=null,St=null,Xo=!1,Ca=!1,Ui=!1,Qo=0,Js=0,Oa=null,dA=0;function bt(){throw Error(r(321))}function nd(i,a){if(a===null)return!1;for(var u=0;u<a.length&&u<i.length;u++)if(!cn(i[u],a[u]))return!1;return!0}function rd(i,a,u,h,y,v){return Xr=v,Be=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,I.H=i===null||i.memoizedState===null?A0:T0,Ui=!1,v=u(h,y),Ui=!1,Ca&&(v=qy(a,u,h,y)),Vy(i),v}function Vy(i){I.H=nu;var a=nt!==null&&nt.next!==null;if(Xr=0,St=nt=Be=null,Xo=!1,Js=0,Oa=null,a)throw Error(r(300));i===null||Rt||(i=i.dependencies,i!==null&&$o(i)&&(Rt=!0))}function qy(i,a,u,h){Be=i;var y=0;do{if(Ca&&(Oa=null),Js=0,Ca=!1,25<=y)throw Error(r(301));if(y+=1,St=nt=null,i.updateQueue!=null){var v=i.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}I.H=vA,v=a(u,h)}while(Ca);return v}function hA(){var i=I.H,a=i.useState()[0];return a=typeof a.then=="function"?Ws(a):a,i=i.useState()[0],(nt!==null?nt.memoizedState:null)!==i&&(Be.flags|=1024),a}function id(){var i=Qo!==0;return Qo=0,i}function ad(i,a,u){a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~u}function sd(i){if(Xo){for(i=i.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Xo=!1}Xr=0,St=nt=Be=null,Ca=!1,Js=Qo=0,Oa=null}function tn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return St===null?Be.memoizedState=St=i:St=St.next=i,St}function kt(){if(nt===null){var i=Be.alternate;i=i!==null?i.memoizedState:null}else i=nt.next;var a=St===null?Be.memoizedState:St.next;if(a!==null)St=a,nt=i;else{if(i===null)throw Be.alternate===null?Error(r(467)):Error(r(310));nt=i,i={memoizedState:nt.memoizedState,baseState:nt.baseState,baseQueue:nt.baseQueue,queue:nt.queue,next:null},St===null?Be.memoizedState=St=i:St=St.next=i}return St}function ld(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ws(i){var a=Js;return Js+=1,Oa===null&&(Oa=[]),i=By(Oa,i,a),a=Be,(St===null?a.memoizedState:St.next)===null&&(a=a.alternate,I.H=a===null||a.memoizedState===null?A0:T0),i}function Ko(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Ws(i);if(i.$$typeof===S)return Ht(i)}throw Error(r(438,String(i)))}function od(i){var a=null,u=Be.updateQueue;if(u!==null&&(a=u.memoCache),a==null){var h=Be.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(a={data:h.data.map(function(y){return y.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),u===null&&(u=ld(),Be.updateQueue=u),u.memoCache=a,u=a.data[a.index],u===void 0)for(u=a.data[a.index]=Array(i),h=0;h<i;h++)u[h]=j;return a.index++,u}function _r(i,a){return typeof a=="function"?a(i):a}function Jo(i){var a=kt();return ud(a,nt,i)}function ud(i,a,u){var h=i.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=u;var y=i.baseQueue,v=h.pending;if(v!==null){if(y!==null){var C=y.next;y.next=v.next,v.next=C}a.baseQueue=y=v,h.pending=null}if(v=i.baseState,y===null)i.memoizedState=v;else{a=y.next;var z=C=null,Z=null,re=a,oe=!1;do{var de=re.lane&-536870913;if(de!==re.lane?(Ve&de)===de:(Xr&de)===de){var ie=re.revertLane;if(ie===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),de===Aa&&(oe=!0);else if((Xr&ie)===ie){re=re.next,ie===Aa&&(oe=!0);continue}else de={lane:0,revertLane:re.revertLane,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},Z===null?(z=Z=de,C=v):Z=Z.next=de,Be.lanes|=ie,ni|=ie;de=re.action,Ui&&u(v,de),v=re.hasEagerState?re.eagerState:u(v,de)}else ie={lane:de,revertLane:re.revertLane,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},Z===null?(z=Z=ie,C=v):Z=Z.next=ie,Be.lanes|=de,ni|=de;re=re.next}while(re!==null&&re!==a);if(Z===null?C=v:Z.next=z,!cn(v,i.memoizedState)&&(Rt=!0,oe&&(u=Ta,u!==null)))throw u;i.memoizedState=v,i.baseState=C,i.baseQueue=Z,h.lastRenderedState=v}return y===null&&(h.lanes=0),[i.memoizedState,h.dispatch]}function cd(i){var a=kt(),u=a.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var h=u.dispatch,y=u.pending,v=a.memoizedState;if(y!==null){u.pending=null;var C=y=y.next;do v=i(v,C.action),C=C.next;while(C!==y);cn(v,a.memoizedState)||(Rt=!0),a.memoizedState=v,a.baseQueue===null&&(a.baseState=v),u.lastRenderedState=v}return[v,h]}function Gy(i,a,u){var h=Be,y=kt(),v=Ke;if(v){if(u===void 0)throw Error(r(407));u=u()}else u=a();var C=!cn((nt||y).memoizedState,u);C&&(y.memoizedState=u,Rt=!0),y=y.queue;var z=Xy.bind(null,h,y,i);if(el(2048,8,z,[i]),y.getSnapshot!==a||C||St!==null&&St.memoizedState.tag&1){if(h.flags|=2048,Ma(9,Wo(),Yy.bind(null,h,y,u,a),null),ot===null)throw Error(r(349));v||(Xr&124)!==0||Zy(h,a,u)}return u}function Zy(i,a,u){i.flags|=16384,i={getSnapshot:a,value:u},a=Be.updateQueue,a===null?(a=ld(),Be.updateQueue=a,a.stores=[i]):(u=a.stores,u===null?a.stores=[i]:u.push(i))}function Yy(i,a,u,h){a.value=u,a.getSnapshot=h,Qy(a)&&Ky(i)}function Xy(i,a,u){return u(function(){Qy(a)&&Ky(i)})}function Qy(i){var a=i.getSnapshot;i=i.value;try{var u=a();return!cn(i,u)}catch{return!0}}function Ky(i){var a=_a(i,2);a!==null&&mn(a,i,2)}function fd(i){var a=tn();if(typeof i=="function"){var u=i;if(i=u(),Ui){Ee(!0);try{u()}finally{Ee(!1)}}}return a.memoizedState=a.baseState=i,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_r,lastRenderedState:i},a}function Jy(i,a,u,h){return i.baseState=u,ud(i,nt,typeof h=="function"?h:_r)}function pA(i,a,u,h,y){if(tu(i))throw Error(r(485));if(i=a.action,i!==null){var v={payload:y,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){v.listeners.push(C)}};I.T!==null?u(!0):v.isTransition=!1,h(v),u=a.pending,u===null?(v.next=a.pending=v,Wy(a,v)):(v.next=u.next,a.pending=u.next=v)}}function Wy(i,a){var u=a.action,h=a.payload,y=i.state;if(a.isTransition){var v=I.T,C={};I.T=C;try{var z=u(y,h),Z=I.S;Z!==null&&Z(C,z),e0(i,a,z)}catch(re){dd(i,a,re)}finally{I.T=v}}else try{v=u(y,h),e0(i,a,v)}catch(re){dd(i,a,re)}}function e0(i,a,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){t0(i,a,h)},function(h){return dd(i,a,h)}):t0(i,a,u)}function t0(i,a,u){a.status="fulfilled",a.value=u,n0(a),i.state=u,a=i.pending,a!==null&&(u=a.next,u===a?i.pending=null:(u=u.next,a.next=u,Wy(i,u)))}function dd(i,a,u){var h=i.pending;if(i.pending=null,h!==null){h=h.next;do a.status="rejected",a.reason=u,n0(a),a=a.next;while(a!==h)}i.action=null}function n0(i){i=i.listeners;for(var a=0;a<i.length;a++)(0,i[a])()}function r0(i,a){return a}function i0(i,a){if(Ke){var u=ot.formState;if(u!==null){e:{var h=Be;if(Ke){if(gt){t:{for(var y=gt,v=Wn;y.nodeType!==8;){if(!v){y=null;break t}if(y=Bn(y.nextSibling),y===null){y=null;break t}}v=y.data,y=v==="F!"||v==="F"?y:null}if(y){gt=Bn(y.nextSibling),h=y.data==="F!";break e}}Ii(h)}h=!1}h&&(a=u[0])}}return u=tn(),u.memoizedState=u.baseState=a,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r0,lastRenderedState:a},u.queue=h,u=S0.bind(null,Be,h),h.dispatch=u,h=fd(!1),v=yd.bind(null,Be,!1,h.queue),h=tn(),y={state:a,dispatch:null,action:i,pending:null},h.queue=y,u=pA.bind(null,Be,y,v,u),y.dispatch=u,h.memoizedState=i,[a,u,!1]}function a0(i){var a=kt();return s0(a,nt,i)}function s0(i,a,u){if(a=ud(i,a,r0)[0],i=Jo(_r)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var h=Ws(a)}catch(C){throw C===Zs?Go:C}else h=a;a=kt();var y=a.queue,v=y.dispatch;return u!==a.memoizedState&&(Be.flags|=2048,Ma(9,Wo(),gA.bind(null,y,u),null)),[h,v,i]}function gA(i,a){i.action=a}function l0(i){var a=kt(),u=nt;if(u!==null)return s0(a,u,i);kt(),a=a.memoizedState,u=kt();var h=u.queue.dispatch;return u.memoizedState=i,[a,h,!1]}function Ma(i,a,u,h){return i={tag:i,create:u,deps:h,inst:a,next:null},a=Be.updateQueue,a===null&&(a=ld(),Be.updateQueue=a),u=a.lastEffect,u===null?a.lastEffect=i.next=i:(h=u.next,u.next=i,i.next=h,a.lastEffect=i),i}function Wo(){return{destroy:void 0,resource:void 0}}function o0(){return kt().memoizedState}function eu(i,a,u,h){var y=tn();h=h===void 0?null:h,Be.flags|=i,y.memoizedState=Ma(1|a,Wo(),u,h)}function el(i,a,u,h){var y=kt();h=h===void 0?null:h;var v=y.memoizedState.inst;nt!==null&&h!==null&&nd(h,nt.memoizedState.deps)?y.memoizedState=Ma(a,v,u,h):(Be.flags|=i,y.memoizedState=Ma(1|a,v,u,h))}function u0(i,a){eu(8390656,8,i,a)}function c0(i,a){el(2048,8,i,a)}function f0(i,a){return el(4,2,i,a)}function d0(i,a){return el(4,4,i,a)}function h0(i,a){if(typeof a=="function"){i=i();var u=a(i);return function(){typeof u=="function"?u():a(null)}}if(a!=null)return i=i(),a.current=i,function(){a.current=null}}function p0(i,a,u){u=u!=null?u.concat([i]):null,el(4,4,h0.bind(null,a,i),u)}function hd(){}function g0(i,a){var u=kt();a=a===void 0?null:a;var h=u.memoizedState;return a!==null&&nd(a,h[1])?h[0]:(u.memoizedState=[i,a],i)}function m0(i,a){var u=kt();a=a===void 0?null:a;var h=u.memoizedState;if(a!==null&&nd(a,h[1]))return h[0];if(h=i(),Ui){Ee(!0);try{i()}finally{Ee(!1)}}return u.memoizedState=[h,a],h}function pd(i,a,u){return u===void 0||(Xr&1073741824)!==0?i.memoizedState=a:(i.memoizedState=u,i=vb(),Be.lanes|=i,ni|=i,u)}function y0(i,a,u,h){return cn(u,a)?u:Na.current!==null?(i=pd(i,u,h),cn(i,a)||(Rt=!0),i):(Xr&42)===0?(Rt=!0,i.memoizedState=u):(i=vb(),Be.lanes|=i,ni|=i,a)}function b0(i,a,u,h,y){var v=P.p;P.p=v!==0&&8>v?v:8;var C=I.T,z={};I.T=z,yd(i,!1,a,u);try{var Z=y(),re=I.S;if(re!==null&&re(z,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var oe=fA(Z,h);tl(i,a,oe,gn(i))}else tl(i,a,h,gn(i))}catch(de){tl(i,a,{then:function(){},status:"rejected",reason:de},gn())}finally{P.p=v,I.T=C}}function mA(){}function gd(i,a,u,h){if(i.tag!==5)throw Error(r(476));var y=v0(i).queue;b0(i,y,a,Y,u===null?mA:function(){return x0(i),u(h)})}function v0(i){var a=i.memoizedState;if(a!==null)return a;a={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_r,lastRenderedState:Y},next:null};var u={};return a.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_r,lastRenderedState:u},next:null},i.memoizedState=a,i=i.alternate,i!==null&&(i.memoizedState=a),a}function x0(i){var a=v0(i).next.queue;tl(i,a,{},gn())}function md(){return Ht(vl)}function w0(){return kt().memoizedState}function _0(){return kt().memoizedState}function yA(i){for(var a=i.return;a!==null;){switch(a.tag){case 24:case 3:var u=gn();i=Zr(u);var h=Yr(a,i,u);h!==null&&(mn(h,a,u),Xs(h,a,u)),a={cache:Gf()},i.payload=a;return}a=a.return}}function bA(i,a,u){var h=gn();u={lane:h,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null},tu(i)?k0(a,u):(u=Lf(i,a,u,h),u!==null&&(mn(u,i,h),E0(u,a,h)))}function S0(i,a,u){var h=gn();tl(i,a,u,h)}function tl(i,a,u,h){var y={lane:h,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null};if(tu(i))k0(a,y);else{var v=i.alternate;if(i.lanes===0&&(v===null||v.lanes===0)&&(v=a.lastRenderedReducer,v!==null))try{var C=a.lastRenderedState,z=v(C,u);if(y.hasEagerState=!0,y.eagerState=z,cn(z,C))return Bo(i,a,y,0),ot===null&&Io(),!1}catch{}finally{}if(u=Lf(i,a,y,h),u!==null)return mn(u,i,h),E0(u,a,h),!0}return!1}function yd(i,a,u,h){if(h={lane:2,revertLane:Xd(),action:h,hasEagerState:!1,eagerState:null,next:null},tu(i)){if(a)throw Error(r(479))}else a=Lf(i,u,h,2),a!==null&&mn(a,i,2)}function tu(i){var a=i.alternate;return i===Be||a!==null&&a===Be}function k0(i,a){Ca=Xo=!0;var u=i.pending;u===null?a.next=a:(a.next=u.next,u.next=a),i.pending=a}function E0(i,a,u){if((u&4194048)!==0){var h=a.lanes;h&=i.pendingLanes,u|=h,a.lanes=u,vo(i,u)}}var nu={readContext:Ht,use:Ko,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useLayoutEffect:bt,useInsertionEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useSyncExternalStore:bt,useId:bt,useHostTransitionStatus:bt,useFormState:bt,useActionState:bt,useOptimistic:bt,useMemoCache:bt,useCacheRefresh:bt},A0={readContext:Ht,use:Ko,useCallback:function(i,a){return tn().memoizedState=[i,a===void 0?null:a],i},useContext:Ht,useEffect:u0,useImperativeHandle:function(i,a,u){u=u!=null?u.concat([i]):null,eu(4194308,4,h0.bind(null,a,i),u)},useLayoutEffect:function(i,a){return eu(4194308,4,i,a)},useInsertionEffect:function(i,a){eu(4,2,i,a)},useMemo:function(i,a){var u=tn();a=a===void 0?null:a;var h=i();if(Ui){Ee(!0);try{i()}finally{Ee(!1)}}return u.memoizedState=[h,a],h},useReducer:function(i,a,u){var h=tn();if(u!==void 0){var y=u(a);if(Ui){Ee(!0);try{u(a)}finally{Ee(!1)}}}else y=a;return h.memoizedState=h.baseState=y,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:y},h.queue=i,i=i.dispatch=bA.bind(null,Be,i),[h.memoizedState,i]},useRef:function(i){var a=tn();return i={current:i},a.memoizedState=i},useState:function(i){i=fd(i);var a=i.queue,u=S0.bind(null,Be,a);return a.dispatch=u,[i.memoizedState,u]},useDebugValue:hd,useDeferredValue:function(i,a){var u=tn();return pd(u,i,a)},useTransition:function(){var i=fd(!1);return i=b0.bind(null,Be,i.queue,!0,!1),tn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,a,u){var h=Be,y=tn();if(Ke){if(u===void 0)throw Error(r(407));u=u()}else{if(u=a(),ot===null)throw Error(r(349));(Ve&124)!==0||Zy(h,a,u)}y.memoizedState=u;var v={value:u,getSnapshot:a};return y.queue=v,u0(Xy.bind(null,h,v,i),[i]),h.flags|=2048,Ma(9,Wo(),Yy.bind(null,h,v,u,a),null),u},useId:function(){var i=tn(),a=ot.identifierPrefix;if(Ke){var u=vr,h=br;u=(h&~(1<<32-Te(h)-1)).toString(32)+u,a="«"+a+"R"+u,u=Qo++,0<u&&(a+="H"+u.toString(32)),a+="»"}else u=dA++,a="«"+a+"r"+u.toString(32)+"»";return i.memoizedState=a},useHostTransitionStatus:md,useFormState:i0,useActionState:i0,useOptimistic:function(i){var a=tn();a.memoizedState=a.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=u,a=yd.bind(null,Be,!0,u),u.dispatch=a,[i,a]},useMemoCache:od,useCacheRefresh:function(){return tn().memoizedState=yA.bind(null,Be)}},T0={readContext:Ht,use:Ko,useCallback:g0,useContext:Ht,useEffect:c0,useImperativeHandle:p0,useInsertionEffect:f0,useLayoutEffect:d0,useMemo:m0,useReducer:Jo,useRef:o0,useState:function(){return Jo(_r)},useDebugValue:hd,useDeferredValue:function(i,a){var u=kt();return y0(u,nt.memoizedState,i,a)},useTransition:function(){var i=Jo(_r)[0],a=kt().memoizedState;return[typeof i=="boolean"?i:Ws(i),a]},useSyncExternalStore:Gy,useId:w0,useHostTransitionStatus:md,useFormState:a0,useActionState:a0,useOptimistic:function(i,a){var u=kt();return Jy(u,nt,i,a)},useMemoCache:od,useCacheRefresh:_0},vA={readContext:Ht,use:Ko,useCallback:g0,useContext:Ht,useEffect:c0,useImperativeHandle:p0,useInsertionEffect:f0,useLayoutEffect:d0,useMemo:m0,useReducer:cd,useRef:o0,useState:function(){return cd(_r)},useDebugValue:hd,useDeferredValue:function(i,a){var u=kt();return nt===null?pd(u,i,a):y0(u,nt.memoizedState,i,a)},useTransition:function(){var i=cd(_r)[0],a=kt().memoizedState;return[typeof i=="boolean"?i:Ws(i),a]},useSyncExternalStore:Gy,useId:w0,useHostTransitionStatus:md,useFormState:l0,useActionState:l0,useOptimistic:function(i,a){var u=kt();return nt!==null?Jy(u,nt,i,a):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:od,useCacheRefresh:_0},Ra=null,nl=0;function ru(i){var a=nl;return nl+=1,Ra===null&&(Ra=[]),By(Ra,i,a)}function rl(i,a){a=a.props.ref,i.ref=a!==void 0?a:null}function iu(i,a){throw a.$$typeof===g?Error(r(525)):(i=Object.prototype.toString.call(a),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":i)))}function N0(i){var a=i._init;return a(i._payload)}function C0(i){function a(ee,Q){if(i){var ne=ee.deletions;ne===null?(ee.deletions=[Q],ee.flags|=16):ne.push(Q)}}function u(ee,Q){if(!i)return null;for(;Q!==null;)a(ee,Q),Q=Q.sibling;return null}function h(ee){for(var Q=new Map;ee!==null;)ee.key!==null?Q.set(ee.key,ee):Q.set(ee.index,ee),ee=ee.sibling;return Q}function y(ee,Q){return ee=yr(ee,Q),ee.index=0,ee.sibling=null,ee}function v(ee,Q,ne){return ee.index=ne,i?(ne=ee.alternate,ne!==null?(ne=ne.index,ne<Q?(ee.flags|=67108866,Q):ne):(ee.flags|=67108866,Q)):(ee.flags|=1048576,Q)}function C(ee){return i&&ee.alternate===null&&(ee.flags|=67108866),ee}function z(ee,Q,ne,ue){return Q===null||Q.tag!==6?(Q=Bf(ne,ee.mode,ue),Q.return=ee,Q):(Q=y(Q,ne),Q.return=ee,Q)}function Z(ee,Q,ne,ue){var xe=ne.type;return xe===x?oe(ee,Q,ne.props.children,ue,ne.key):Q!==null&&(Q.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===L&&N0(xe)===Q.type)?(Q=y(Q,ne.props),rl(Q,ne),Q.return=ee,Q):(Q=Po(ne.type,ne.key,ne.props,null,ee.mode,ue),rl(Q,ne),Q.return=ee,Q)}function re(ee,Q,ne,ue){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==ne.containerInfo||Q.stateNode.implementation!==ne.implementation?(Q=Ff(ne,ee.mode,ue),Q.return=ee,Q):(Q=y(Q,ne.children||[]),Q.return=ee,Q)}function oe(ee,Q,ne,ue,xe){return Q===null||Q.tag!==7?(Q=Di(ne,ee.mode,ue,xe),Q.return=ee,Q):(Q=y(Q,ne),Q.return=ee,Q)}function de(ee,Q,ne){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=Bf(""+Q,ee.mode,ne),Q.return=ee,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case m:return ne=Po(Q.type,Q.key,Q.props,null,ee.mode,ne),rl(ne,Q),ne.return=ee,ne;case b:return Q=Ff(Q,ee.mode,ne),Q.return=ee,Q;case L:var ue=Q._init;return Q=ue(Q._payload),de(ee,Q,ne)}if($(Q)||B(Q))return Q=Di(Q,ee.mode,ne,null),Q.return=ee,Q;if(typeof Q.then=="function")return de(ee,ru(Q),ne);if(Q.$$typeof===S)return de(ee,Vo(ee,Q),ne);iu(ee,Q)}return null}function ie(ee,Q,ne,ue){var xe=Q!==null?Q.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return xe!==null?null:z(ee,Q,""+ne,ue);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case m:return ne.key===xe?Z(ee,Q,ne,ue):null;case b:return ne.key===xe?re(ee,Q,ne,ue):null;case L:return xe=ne._init,ne=xe(ne._payload),ie(ee,Q,ne,ue)}if($(ne)||B(ne))return xe!==null?null:oe(ee,Q,ne,ue,null);if(typeof ne.then=="function")return ie(ee,Q,ru(ne),ue);if(ne.$$typeof===S)return ie(ee,Q,Vo(ee,ne),ue);iu(ee,ne)}return null}function ae(ee,Q,ne,ue,xe){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return ee=ee.get(ne)||null,z(Q,ee,""+ue,xe);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case m:return ee=ee.get(ue.key===null?ne:ue.key)||null,Z(Q,ee,ue,xe);case b:return ee=ee.get(ue.key===null?ne:ue.key)||null,re(Q,ee,ue,xe);case L:var Fe=ue._init;return ue=Fe(ue._payload),ae(ee,Q,ne,ue,xe)}if($(ue)||B(ue))return ee=ee.get(ne)||null,oe(Q,ee,ue,xe,null);if(typeof ue.then=="function")return ae(ee,Q,ne,ru(ue),xe);if(ue.$$typeof===S)return ae(ee,Q,ne,Vo(Q,ue),xe);iu(Q,ue)}return null}function Re(ee,Q,ne,ue){for(var xe=null,Fe=null,ke=Q,Me=Q=0,jt=null;ke!==null&&Me<ne.length;Me++){ke.index>Me?(jt=ke,ke=null):jt=ke.sibling;var Ye=ie(ee,ke,ne[Me],ue);if(Ye===null){ke===null&&(ke=jt);break}i&&ke&&Ye.alternate===null&&a(ee,ke),Q=v(Ye,Q,Me),Fe===null?xe=Ye:Fe.sibling=Ye,Fe=Ye,ke=jt}if(Me===ne.length)return u(ee,ke),Ke&&zi(ee,Me),xe;if(ke===null){for(;Me<ne.length;Me++)ke=de(ee,ne[Me],ue),ke!==null&&(Q=v(ke,Q,Me),Fe===null?xe=ke:Fe.sibling=ke,Fe=ke);return Ke&&zi(ee,Me),xe}for(ke=h(ke);Me<ne.length;Me++)jt=ae(ke,ee,Me,ne[Me],ue),jt!==null&&(i&&jt.alternate!==null&&ke.delete(jt.key===null?Me:jt.key),Q=v(jt,Q,Me),Fe===null?xe=jt:Fe.sibling=jt,Fe=jt);return i&&ke.forEach(function(fi){return a(ee,fi)}),Ke&&zi(ee,Me),xe}function Oe(ee,Q,ne,ue){if(ne==null)throw Error(r(151));for(var xe=null,Fe=null,ke=Q,Me=Q=0,jt=null,Ye=ne.next();ke!==null&&!Ye.done;Me++,Ye=ne.next()){ke.index>Me?(jt=ke,ke=null):jt=ke.sibling;var fi=ie(ee,ke,Ye.value,ue);if(fi===null){ke===null&&(ke=jt);break}i&&ke&&fi.alternate===null&&a(ee,ke),Q=v(fi,Q,Me),Fe===null?xe=fi:Fe.sibling=fi,Fe=fi,ke=jt}if(Ye.done)return u(ee,ke),Ke&&zi(ee,Me),xe;if(ke===null){for(;!Ye.done;Me++,Ye=ne.next())Ye=de(ee,Ye.value,ue),Ye!==null&&(Q=v(Ye,Q,Me),Fe===null?xe=Ye:Fe.sibling=Ye,Fe=Ye);return Ke&&zi(ee,Me),xe}for(ke=h(ke);!Ye.done;Me++,Ye=ne.next())Ye=ae(ke,ee,Me,Ye.value,ue),Ye!==null&&(i&&Ye.alternate!==null&&ke.delete(Ye.key===null?Me:Ye.key),Q=v(Ye,Q,Me),Fe===null?xe=Ye:Fe.sibling=Ye,Fe=Ye);return i&&ke.forEach(function(xT){return a(ee,xT)}),Ke&&zi(ee,Me),xe}function it(ee,Q,ne,ue){if(typeof ne=="object"&&ne!==null&&ne.type===x&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case m:e:{for(var xe=ne.key;Q!==null;){if(Q.key===xe){if(xe=ne.type,xe===x){if(Q.tag===7){u(ee,Q.sibling),ue=y(Q,ne.props.children),ue.return=ee,ee=ue;break e}}else if(Q.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===L&&N0(xe)===Q.type){u(ee,Q.sibling),ue=y(Q,ne.props),rl(ue,ne),ue.return=ee,ee=ue;break e}u(ee,Q);break}else a(ee,Q);Q=Q.sibling}ne.type===x?(ue=Di(ne.props.children,ee.mode,ue,ne.key),ue.return=ee,ee=ue):(ue=Po(ne.type,ne.key,ne.props,null,ee.mode,ue),rl(ue,ne),ue.return=ee,ee=ue)}return C(ee);case b:e:{for(xe=ne.key;Q!==null;){if(Q.key===xe)if(Q.tag===4&&Q.stateNode.containerInfo===ne.containerInfo&&Q.stateNode.implementation===ne.implementation){u(ee,Q.sibling),ue=y(Q,ne.children||[]),ue.return=ee,ee=ue;break e}else{u(ee,Q);break}else a(ee,Q);Q=Q.sibling}ue=Ff(ne,ee.mode,ue),ue.return=ee,ee=ue}return C(ee);case L:return xe=ne._init,ne=xe(ne._payload),it(ee,Q,ne,ue)}if($(ne))return Re(ee,Q,ne,ue);if(B(ne)){if(xe=B(ne),typeof xe!="function")throw Error(r(150));return ne=xe.call(ne),Oe(ee,Q,ne,ue)}if(typeof ne.then=="function")return it(ee,Q,ru(ne),ue);if(ne.$$typeof===S)return it(ee,Q,Vo(ee,ne),ue);iu(ee,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,Q!==null&&Q.tag===6?(u(ee,Q.sibling),ue=y(Q,ne),ue.return=ee,ee=ue):(u(ee,Q),ue=Bf(ne,ee.mode,ue),ue.return=ee,ee=ue),C(ee)):u(ee,Q)}return function(ee,Q,ne,ue){try{nl=0;var xe=it(ee,Q,ne,ue);return Ra=null,xe}catch(ke){if(ke===Zs||ke===Go)throw ke;var Fe=fn(29,ke,null,ee.mode);return Fe.lanes=ue,Fe.return=ee,Fe}finally{}}}var Da=C0(!0),O0=C0(!1),Nn=G(null),er=null;function Qr(i){var a=i.alternate;T(Ot,Ot.current&1),T(Nn,i),er===null&&(a===null||Na.current!==null||a.memoizedState!==null)&&(er=i)}function M0(i){if(i.tag===22){if(T(Ot,Ot.current),T(Nn,i),er===null){var a=i.alternate;a!==null&&a.memoizedState!==null&&(er=i)}}else Kr()}function Kr(){T(Ot,Ot.current),T(Nn,Nn.current)}function Sr(i){te(Nn),er===i&&(er=null),te(Ot)}var Ot=G(0);function au(i){for(var a=i;a!==null;){if(a.tag===13){var u=a.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||lh(u)))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}function bd(i,a,u,h){a=i.memoizedState,u=u(h,a),u=u==null?a:p({},a,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var vd={enqueueSetState:function(i,a,u){i=i._reactInternals;var h=gn(),y=Zr(h);y.payload=a,u!=null&&(y.callback=u),a=Yr(i,y,h),a!==null&&(mn(a,i,h),Xs(a,i,h))},enqueueReplaceState:function(i,a,u){i=i._reactInternals;var h=gn(),y=Zr(h);y.tag=1,y.payload=a,u!=null&&(y.callback=u),a=Yr(i,y,h),a!==null&&(mn(a,i,h),Xs(a,i,h))},enqueueForceUpdate:function(i,a){i=i._reactInternals;var u=gn(),h=Zr(u);h.tag=2,a!=null&&(h.callback=a),a=Yr(i,h,u),a!==null&&(mn(a,i,u),Xs(a,i,u))}};function R0(i,a,u,h,y,v,C){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(h,v,C):a.prototype&&a.prototype.isPureReactComponent?!Fs(u,h)||!Fs(y,v):!0}function D0(i,a,u,h){i=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(u,h),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(u,h),a.state!==i&&vd.enqueueReplaceState(a,a.state,null)}function Hi(i,a){var u=a;if("ref"in a){u={};for(var h in a)h!=="ref"&&(u[h]=a[h])}if(i=i.defaultProps){u===a&&(u=p({},u));for(var y in i)u[y]===void 0&&(u[y]=i[y])}return u}var su=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)};function j0(i){su(i)}function z0(i){console.error(i)}function L0(i){su(i)}function lu(i,a){try{var u=i.onUncaughtError;u(a.value,{componentStack:a.stack})}catch(h){setTimeout(function(){throw h})}}function I0(i,a,u){try{var h=i.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function xd(i,a,u){return u=Zr(u),u.tag=3,u.payload={element:null},u.callback=function(){lu(i,a)},u}function B0(i){return i=Zr(i),i.tag=3,i}function F0(i,a,u,h){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var v=h.value;i.payload=function(){return y(v)},i.callback=function(){I0(a,u,h)}}var C=u.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(i.callback=function(){I0(a,u,h),typeof y!="function"&&(ri===null?ri=new Set([this]):ri.add(this));var z=h.stack;this.componentDidCatch(h.value,{componentStack:z!==null?z:""})})}function xA(i,a,u,h,y){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(a=u.alternate,a!==null&&Vs(a,u,y,!0),u=Nn.current,u!==null){switch(u.tag){case 13:return er===null?Vd():u.alternate===null&&mt===0&&(mt=3),u.flags&=-257,u.flags|=65536,u.lanes=y,h===Xf?u.flags|=16384:(a=u.updateQueue,a===null?u.updateQueue=new Set([h]):a.add(h),Gd(i,h,y)),!1;case 22:return u.flags|=65536,h===Xf?u.flags|=16384:(a=u.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=a):(u=a.retryQueue,u===null?a.retryQueue=new Set([h]):u.add(h)),Gd(i,h,y)),!1}throw Error(r(435,u.tag))}return Gd(i,h,y),Vd(),!1}if(Ke)return a=Nn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=y,h!==Hf&&(i=Error(r(422),{cause:h}),$s(kn(i,u)))):(h!==Hf&&(a=Error(r(423),{cause:h}),$s(kn(a,u))),i=i.current.alternate,i.flags|=65536,y&=-y,i.lanes|=y,h=kn(h,u),y=xd(i.stateNode,h,y),Jf(i,y),mt!==4&&(mt=2)),!1;var v=Error(r(520),{cause:h});if(v=kn(v,u),cl===null?cl=[v]:cl.push(v),mt!==4&&(mt=2),a===null)return!0;h=kn(h,u),u=a;do{switch(u.tag){case 3:return u.flags|=65536,i=y&-y,u.lanes|=i,i=xd(u.stateNode,h,i),Jf(u,i),!1;case 1:if(a=u.type,v=u.stateNode,(u.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(ri===null||!ri.has(v))))return u.flags|=65536,y&=-y,u.lanes|=y,y=B0(y),F0(y,i,u,h),Jf(u,y),!1}u=u.return}while(u!==null);return!1}var P0=Error(r(461)),Rt=!1;function zt(i,a,u,h){a.child=i===null?O0(a,null,u,h):Da(a,i.child,u,h)}function U0(i,a,u,h,y){u=u.render;var v=a.ref;if("ref"in h){var C={};for(var z in h)z!=="ref"&&(C[z]=h[z])}else C=h;return Fi(a),h=rd(i,a,u,C,v,y),z=id(),i!==null&&!Rt?(ad(i,a,y),kr(i,a,y)):(Ke&&z&&Pf(a),a.flags|=1,zt(i,a,h,y),a.child)}function H0(i,a,u,h,y){if(i===null){var v=u.type;return typeof v=="function"&&!If(v)&&v.defaultProps===void 0&&u.compare===null?(a.tag=15,a.type=v,$0(i,a,v,h,y)):(i=Po(u.type,null,h,a,a.mode,y),i.ref=a.ref,i.return=a,a.child=i)}if(v=i.child,!Nd(i,y)){var C=v.memoizedProps;if(u=u.compare,u=u!==null?u:Fs,u(C,h)&&i.ref===a.ref)return kr(i,a,y)}return a.flags|=1,i=yr(v,h),i.ref=a.ref,i.return=a,a.child=i}function $0(i,a,u,h,y){if(i!==null){var v=i.memoizedProps;if(Fs(v,h)&&i.ref===a.ref)if(Rt=!1,a.pendingProps=h=v,Nd(i,y))(i.flags&131072)!==0&&(Rt=!0);else return a.lanes=i.lanes,kr(i,a,y)}return wd(i,a,u,h,y)}function V0(i,a,u){var h=a.pendingProps,y=h.children,v=i!==null?i.memoizedState:null;if(h.mode==="hidden"){if((a.flags&128)!==0){if(h=v!==null?v.baseLanes|u:u,i!==null){for(y=a.child=i.child,v=0;y!==null;)v=v|y.lanes|y.childLanes,y=y.sibling;a.childLanes=v&~h}else a.childLanes=0,a.child=null;return q0(i,a,h,u)}if((u&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},i!==null&&qo(a,v!==null?v.cachePool:null),v!==null?$y(a,v):ed(),M0(a);else return a.lanes=a.childLanes=536870912,q0(i,a,v!==null?v.baseLanes|u:u,u)}else v!==null?(qo(a,v.cachePool),$y(a,v),Kr(),a.memoizedState=null):(i!==null&&qo(a,null),ed(),Kr());return zt(i,a,y,u),a.child}function q0(i,a,u,h){var y=Yf();return y=y===null?null:{parent:Ct._currentValue,pool:y},a.memoizedState={baseLanes:u,cachePool:y},i!==null&&qo(a,null),ed(),M0(a),i!==null&&Vs(i,a,h,!0),null}function ou(i,a){var u=a.ref;if(u===null)i!==null&&i.ref!==null&&(a.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(i===null||i.ref!==u)&&(a.flags|=4194816)}}function wd(i,a,u,h,y){return Fi(a),u=rd(i,a,u,h,void 0,y),h=id(),i!==null&&!Rt?(ad(i,a,y),kr(i,a,y)):(Ke&&h&&Pf(a),a.flags|=1,zt(i,a,u,y),a.child)}function G0(i,a,u,h,y,v){return Fi(a),a.updateQueue=null,u=qy(a,h,u,y),Vy(i),h=id(),i!==null&&!Rt?(ad(i,a,v),kr(i,a,v)):(Ke&&h&&Pf(a),a.flags|=1,zt(i,a,u,v),a.child)}function Z0(i,a,u,h,y){if(Fi(a),a.stateNode===null){var v=Sa,C=u.contextType;typeof C=="object"&&C!==null&&(v=Ht(C)),v=new u(h,v),a.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=vd,a.stateNode=v,v._reactInternals=a,v=a.stateNode,v.props=h,v.state=a.memoizedState,v.refs={},Qf(a),C=u.contextType,v.context=typeof C=="object"&&C!==null?Ht(C):Sa,v.state=a.memoizedState,C=u.getDerivedStateFromProps,typeof C=="function"&&(bd(a,u,C,h),v.state=a.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(C=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),C!==v.state&&vd.enqueueReplaceState(v,v.state,null),Ks(a,h,v,y),Qs(),v.state=a.memoizedState),typeof v.componentDidMount=="function"&&(a.flags|=4194308),h=!0}else if(i===null){v=a.stateNode;var z=a.memoizedProps,Z=Hi(u,z);v.props=Z;var re=v.context,oe=u.contextType;C=Sa,typeof oe=="object"&&oe!==null&&(C=Ht(oe));var de=u.getDerivedStateFromProps;oe=typeof de=="function"||typeof v.getSnapshotBeforeUpdate=="function",z=a.pendingProps!==z,oe||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(z||re!==C)&&D0(a,v,h,C),Gr=!1;var ie=a.memoizedState;v.state=ie,Ks(a,h,v,y),Qs(),re=a.memoizedState,z||ie!==re||Gr?(typeof de=="function"&&(bd(a,u,de,h),re=a.memoizedState),(Z=Gr||R0(a,u,Z,h,ie,re,C))?(oe||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(a.flags|=4194308)):(typeof v.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=h,a.memoizedState=re),v.props=h,v.state=re,v.context=C,h=Z):(typeof v.componentDidMount=="function"&&(a.flags|=4194308),h=!1)}else{v=a.stateNode,Kf(i,a),C=a.memoizedProps,oe=Hi(u,C),v.props=oe,de=a.pendingProps,ie=v.context,re=u.contextType,Z=Sa,typeof re=="object"&&re!==null&&(Z=Ht(re)),z=u.getDerivedStateFromProps,(re=typeof z=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(C!==de||ie!==Z)&&D0(a,v,h,Z),Gr=!1,ie=a.memoizedState,v.state=ie,Ks(a,h,v,y),Qs();var ae=a.memoizedState;C!==de||ie!==ae||Gr||i!==null&&i.dependencies!==null&&$o(i.dependencies)?(typeof z=="function"&&(bd(a,u,z,h),ae=a.memoizedState),(oe=Gr||R0(a,u,oe,h,ie,ae,Z)||i!==null&&i.dependencies!==null&&$o(i.dependencies))?(re||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(h,ae,Z),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(h,ae,Z)),typeof v.componentDidUpdate=="function"&&(a.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof v.componentDidUpdate!="function"||C===i.memoizedProps&&ie===i.memoizedState||(a.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===i.memoizedProps&&ie===i.memoizedState||(a.flags|=1024),a.memoizedProps=h,a.memoizedState=ae),v.props=h,v.state=ae,v.context=Z,h=oe):(typeof v.componentDidUpdate!="function"||C===i.memoizedProps&&ie===i.memoizedState||(a.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===i.memoizedProps&&ie===i.memoizedState||(a.flags|=1024),h=!1)}return v=h,ou(i,a),h=(a.flags&128)!==0,v||h?(v=a.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:v.render(),a.flags|=1,i!==null&&h?(a.child=Da(a,i.child,null,y),a.child=Da(a,null,u,y)):zt(i,a,u,y),a.memoizedState=v.state,i=a.child):i=kr(i,a,y),i}function Y0(i,a,u,h){return Hs(),a.flags|=256,zt(i,a,u,h),a.child}var _d={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sd(i){return{baseLanes:i,cachePool:zy()}}function kd(i,a,u){return i=i!==null?i.childLanes&~u:0,a&&(i|=Cn),i}function X0(i,a,u){var h=a.pendingProps,y=!1,v=(a.flags&128)!==0,C;if((C=v)||(C=i!==null&&i.memoizedState===null?!1:(Ot.current&2)!==0),C&&(y=!0,a.flags&=-129),C=(a.flags&32)!==0,a.flags&=-33,i===null){if(Ke){if(y?Qr(a):Kr(),Ke){var z=gt,Z;if(Z=z){e:{for(Z=z,z=Wn;Z.nodeType!==8;){if(!z){z=null;break e}if(Z=Bn(Z.nextSibling),Z===null){z=null;break e}}z=Z}z!==null?(a.memoizedState={dehydrated:z,treeContext:ji!==null?{id:br,overflow:vr}:null,retryLane:536870912,hydrationErrors:null},Z=fn(18,null,null,0),Z.stateNode=z,Z.return=a,a.child=Z,Yt=a,gt=null,Z=!0):Z=!1}Z||Ii(a)}if(z=a.memoizedState,z!==null&&(z=z.dehydrated,z!==null))return lh(z)?a.lanes=32:a.lanes=536870912,null;Sr(a)}return z=h.children,h=h.fallback,y?(Kr(),y=a.mode,z=uu({mode:"hidden",children:z},y),h=Di(h,y,u,null),z.return=a,h.return=a,z.sibling=h,a.child=z,y=a.child,y.memoizedState=Sd(u),y.childLanes=kd(i,C,u),a.memoizedState=_d,h):(Qr(a),Ed(a,z))}if(Z=i.memoizedState,Z!==null&&(z=Z.dehydrated,z!==null)){if(v)a.flags&256?(Qr(a),a.flags&=-257,a=Ad(i,a,u)):a.memoizedState!==null?(Kr(),a.child=i.child,a.flags|=128,a=null):(Kr(),y=h.fallback,z=a.mode,h=uu({mode:"visible",children:h.children},z),y=Di(y,z,u,null),y.flags|=2,h.return=a,y.return=a,h.sibling=y,a.child=h,Da(a,i.child,null,u),h=a.child,h.memoizedState=Sd(u),h.childLanes=kd(i,C,u),a.memoizedState=_d,a=y);else if(Qr(a),lh(z)){if(C=z.nextSibling&&z.nextSibling.dataset,C)var re=C.dgst;C=re,h=Error(r(419)),h.stack="",h.digest=C,$s({value:h,source:null,stack:null}),a=Ad(i,a,u)}else if(Rt||Vs(i,a,u,!1),C=(u&i.childLanes)!==0,Rt||C){if(C=ot,C!==null&&(h=u&-u,h=(h&42)!==0?1:ks(h),h=(h&(C.suspendedLanes|u))!==0?0:h,h!==0&&h!==Z.retryLane))throw Z.retryLane=h,_a(i,h),mn(C,i,h),P0;z.data==="$?"||Vd(),a=Ad(i,a,u)}else z.data==="$?"?(a.flags|=192,a.child=i.child,a=null):(i=Z.treeContext,gt=Bn(z.nextSibling),Yt=a,Ke=!0,Li=null,Wn=!1,i!==null&&(An[Tn++]=br,An[Tn++]=vr,An[Tn++]=ji,br=i.id,vr=i.overflow,ji=a),a=Ed(a,h.children),a.flags|=4096);return a}return y?(Kr(),y=h.fallback,z=a.mode,Z=i.child,re=Z.sibling,h=yr(Z,{mode:"hidden",children:h.children}),h.subtreeFlags=Z.subtreeFlags&65011712,re!==null?y=yr(re,y):(y=Di(y,z,u,null),y.flags|=2),y.return=a,h.return=a,h.sibling=y,a.child=h,h=y,y=a.child,z=i.child.memoizedState,z===null?z=Sd(u):(Z=z.cachePool,Z!==null?(re=Ct._currentValue,Z=Z.parent!==re?{parent:re,pool:re}:Z):Z=zy(),z={baseLanes:z.baseLanes|u,cachePool:Z}),y.memoizedState=z,y.childLanes=kd(i,C,u),a.memoizedState=_d,h):(Qr(a),u=i.child,i=u.sibling,u=yr(u,{mode:"visible",children:h.children}),u.return=a,u.sibling=null,i!==null&&(C=a.deletions,C===null?(a.deletions=[i],a.flags|=16):C.push(i)),a.child=u,a.memoizedState=null,u)}function Ed(i,a){return a=uu({mode:"visible",children:a},i.mode),a.return=i,i.child=a}function uu(i,a){return i=fn(22,i,null,a),i.lanes=0,i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},i}function Ad(i,a,u){return Da(a,i.child,null,u),i=Ed(a,a.pendingProps.children),i.flags|=2,a.memoizedState=null,i}function Q0(i,a,u){i.lanes|=a;var h=i.alternate;h!==null&&(h.lanes|=a),Vf(i.return,a,u)}function Td(i,a,u,h,y){var v=i.memoizedState;v===null?i.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:y}:(v.isBackwards=a,v.rendering=null,v.renderingStartTime=0,v.last=h,v.tail=u,v.tailMode=y)}function K0(i,a,u){var h=a.pendingProps,y=h.revealOrder,v=h.tail;if(zt(i,a,h.children,u),h=Ot.current,(h&2)!==0)h=h&1|2,a.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=a.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Q0(i,u,a);else if(i.tag===19)Q0(i,u,a);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break e;for(;i.sibling===null;){if(i.return===null||i.return===a)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}h&=1}switch(T(Ot,h),y){case"forwards":for(u=a.child,y=null;u!==null;)i=u.alternate,i!==null&&au(i)===null&&(y=u),u=u.sibling;u=y,u===null?(y=a.child,a.child=null):(y=u.sibling,u.sibling=null),Td(a,!1,y,u,v);break;case"backwards":for(u=null,y=a.child,a.child=null;y!==null;){if(i=y.alternate,i!==null&&au(i)===null){a.child=y;break}i=y.sibling,y.sibling=u,u=y,y=i}Td(a,!0,u,null,v);break;case"together":Td(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function kr(i,a,u){if(i!==null&&(a.dependencies=i.dependencies),ni|=a.lanes,(u&a.childLanes)===0)if(i!==null){if(Vs(i,a,u,!1),(u&a.childLanes)===0)return null}else return null;if(i!==null&&a.child!==i.child)throw Error(r(153));if(a.child!==null){for(i=a.child,u=yr(i,i.pendingProps),a.child=u,u.return=a;i.sibling!==null;)i=i.sibling,u=u.sibling=yr(i,i.pendingProps),u.return=a;u.sibling=null}return a.child}function Nd(i,a){return(i.lanes&a)!==0?!0:(i=i.dependencies,!!(i!==null&&$o(i)))}function wA(i,a,u){switch(a.tag){case 3:fe(a,a.stateNode.containerInfo),qr(a,Ct,i.memoizedState.cache),Hs();break;case 27:case 5:Ae(a);break;case 4:fe(a,a.stateNode.containerInfo);break;case 10:qr(a,a.type,a.memoizedProps.value);break;case 13:var h=a.memoizedState;if(h!==null)return h.dehydrated!==null?(Qr(a),a.flags|=128,null):(u&a.child.childLanes)!==0?X0(i,a,u):(Qr(a),i=kr(i,a,u),i!==null?i.sibling:null);Qr(a);break;case 19:var y=(i.flags&128)!==0;if(h=(u&a.childLanes)!==0,h||(Vs(i,a,u,!1),h=(u&a.childLanes)!==0),y){if(h)return K0(i,a,u);a.flags|=128}if(y=a.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),T(Ot,Ot.current),h)break;return null;case 22:case 23:return a.lanes=0,V0(i,a,u);case 24:qr(a,Ct,i.memoizedState.cache)}return kr(i,a,u)}function J0(i,a,u){if(i!==null)if(i.memoizedProps!==a.pendingProps)Rt=!0;else{if(!Nd(i,u)&&(a.flags&128)===0)return Rt=!1,wA(i,a,u);Rt=(i.flags&131072)!==0}else Rt=!1,Ke&&(a.flags&1048576)!==0&&Ny(a,Ho,a.index);switch(a.lanes=0,a.tag){case 16:e:{i=a.pendingProps;var h=a.elementType,y=h._init;if(h=y(h._payload),a.type=h,typeof h=="function")If(h)?(i=Hi(h,i),a.tag=1,a=Z0(null,a,h,i,u)):(a.tag=0,a=wd(null,a,h,i,u));else{if(h!=null){if(y=h.$$typeof,y===O){a.tag=11,a=U0(null,a,h,i,u);break e}else if(y===F){a.tag=14,a=H0(null,a,h,i,u);break e}}throw a=R(h)||h,Error(r(306,a,""))}}return a;case 0:return wd(i,a,a.type,a.pendingProps,u);case 1:return h=a.type,y=Hi(h,a.pendingProps),Z0(i,a,h,y,u);case 3:e:{if(fe(a,a.stateNode.containerInfo),i===null)throw Error(r(387));h=a.pendingProps;var v=a.memoizedState;y=v.element,Kf(i,a),Ks(a,h,null,u);var C=a.memoizedState;if(h=C.cache,qr(a,Ct,h),h!==v.cache&&qf(a,[Ct],u,!0),Qs(),h=C.element,v.isDehydrated)if(v={element:h,isDehydrated:!1,cache:C.cache},a.updateQueue.baseState=v,a.memoizedState=v,a.flags&256){a=Y0(i,a,h,u);break e}else if(h!==y){y=kn(Error(r(424)),a),$s(y),a=Y0(i,a,h,u);break e}else{switch(i=a.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(gt=Bn(i.firstChild),Yt=a,Ke=!0,Li=null,Wn=!0,u=O0(a,null,h,u),a.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Hs(),h===y){a=kr(i,a,u);break e}zt(i,a,h,u)}a=a.child}return a;case 26:return ou(i,a),i===null?(u=nv(a.type,null,a.pendingProps,null))?a.memoizedState=u:Ke||(u=a.type,i=a.pendingProps,h=Su(J.current).createElement(u),h[Mt]=a,h[Ut]=i,It(h,u,i),_t(h),a.stateNode=h):a.memoizedState=nv(a.type,i.memoizedProps,a.pendingProps,i.memoizedState),null;case 27:return Ae(a),i===null&&Ke&&(h=a.stateNode=Wb(a.type,a.pendingProps,J.current),Yt=a,Wn=!0,y=gt,si(a.type)?(oh=y,gt=Bn(h.firstChild)):gt=y),zt(i,a,a.pendingProps.children,u),ou(i,a),i===null&&(a.flags|=4194304),a.child;case 5:return i===null&&Ke&&((y=h=gt)&&(h=XA(h,a.type,a.pendingProps,Wn),h!==null?(a.stateNode=h,Yt=a,gt=Bn(h.firstChild),Wn=!1,y=!0):y=!1),y||Ii(a)),Ae(a),y=a.type,v=a.pendingProps,C=i!==null?i.memoizedProps:null,h=v.children,ih(y,v)?h=null:C!==null&&ih(y,C)&&(a.flags|=32),a.memoizedState!==null&&(y=rd(i,a,hA,null,null,u),vl._currentValue=y),ou(i,a),zt(i,a,h,u),a.child;case 6:return i===null&&Ke&&((i=u=gt)&&(u=QA(u,a.pendingProps,Wn),u!==null?(a.stateNode=u,Yt=a,gt=null,i=!0):i=!1),i||Ii(a)),null;case 13:return X0(i,a,u);case 4:return fe(a,a.stateNode.containerInfo),h=a.pendingProps,i===null?a.child=Da(a,null,h,u):zt(i,a,h,u),a.child;case 11:return U0(i,a,a.type,a.pendingProps,u);case 7:return zt(i,a,a.pendingProps,u),a.child;case 8:return zt(i,a,a.pendingProps.children,u),a.child;case 12:return zt(i,a,a.pendingProps.children,u),a.child;case 10:return h=a.pendingProps,qr(a,a.type,h.value),zt(i,a,h.children,u),a.child;case 9:return y=a.type._context,h=a.pendingProps.children,Fi(a),y=Ht(y),h=h(y),a.flags|=1,zt(i,a,h,u),a.child;case 14:return H0(i,a,a.type,a.pendingProps,u);case 15:return $0(i,a,a.type,a.pendingProps,u);case 19:return K0(i,a,u);case 31:return h=a.pendingProps,u=a.mode,h={mode:h.mode,children:h.children},i===null?(u=uu(h,u),u.ref=a.ref,a.child=u,u.return=a,a=u):(u=yr(i.child,h),u.ref=a.ref,a.child=u,u.return=a,a=u),a;case 22:return V0(i,a,u);case 24:return Fi(a),h=Ht(Ct),i===null?(y=Yf(),y===null&&(y=ot,v=Gf(),y.pooledCache=v,v.refCount++,v!==null&&(y.pooledCacheLanes|=u),y=v),a.memoizedState={parent:h,cache:y},Qf(a),qr(a,Ct,y)):((i.lanes&u)!==0&&(Kf(i,a),Ks(a,null,null,u),Qs()),y=i.memoizedState,v=a.memoizedState,y.parent!==h?(y={parent:h,cache:h},a.memoizedState=y,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=y),qr(a,Ct,h)):(h=v.cache,qr(a,Ct,h),h!==y.cache&&qf(a,[Ct],u,!0))),zt(i,a,a.pendingProps.children,u),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function Er(i){i.flags|=4}function W0(i,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!lv(a)){if(a=Nn.current,a!==null&&((Ve&4194048)===Ve?er!==null:(Ve&62914560)!==Ve&&(Ve&536870912)===0||a!==er))throw Ys=Xf,Ly;i.flags|=8192}}function cu(i,a){a!==null&&(i.flags|=4),i.flags&16384&&(a=i.tag!==22?bo():536870912,i.lanes|=a,Ia|=a)}function il(i,a){if(!Ke)switch(i.tailMode){case"hidden":a=i.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?a||i.tail===null?i.tail=null:i.tail.sibling=null:h.sibling=null}}function pt(i){var a=i.alternate!==null&&i.alternate.child===i.child,u=0,h=0;if(a)for(var y=i.child;y!==null;)u|=y.lanes|y.childLanes,h|=y.subtreeFlags&65011712,h|=y.flags&65011712,y.return=i,y=y.sibling;else for(y=i.child;y!==null;)u|=y.lanes|y.childLanes,h|=y.subtreeFlags,h|=y.flags,y.return=i,y=y.sibling;return i.subtreeFlags|=h,i.childLanes=u,a}function _A(i,a,u){var h=a.pendingProps;switch(Uf(a),a.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pt(a),null;case 1:return pt(a),null;case 3:return u=a.stateNode,h=null,i!==null&&(h=i.memoizedState.cache),a.memoizedState.cache!==h&&(a.flags|=2048),wr(Ct),ye(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(Us(a)?Er(a):i===null||i.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,My())),pt(a),null;case 26:return u=a.memoizedState,i===null?(Er(a),u!==null?(pt(a),W0(a,u)):(pt(a),a.flags&=-16777217)):u?u!==i.memoizedState?(Er(a),pt(a),W0(a,u)):(pt(a),a.flags&=-16777217):(i.memoizedProps!==h&&Er(a),pt(a),a.flags&=-16777217),null;case 27:Se(a),u=J.current;var y=a.type;if(i!==null&&a.stateNode!=null)i.memoizedProps!==h&&Er(a);else{if(!h){if(a.stateNode===null)throw Error(r(166));return pt(a),null}i=V.current,Us(a)?Cy(a):(i=Wb(y,h,u),a.stateNode=i,Er(a))}return pt(a),null;case 5:if(Se(a),u=a.type,i!==null&&a.stateNode!=null)i.memoizedProps!==h&&Er(a);else{if(!h){if(a.stateNode===null)throw Error(r(166));return pt(a),null}if(i=V.current,Us(a))Cy(a);else{switch(y=Su(J.current),i){case 1:i=y.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:i=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":i=y.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":i=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":i=y.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof h.is=="string"?y.createElement("select",{is:h.is}):y.createElement("select"),h.multiple?i.multiple=!0:h.size&&(i.size=h.size);break;default:i=typeof h.is=="string"?y.createElement(u,{is:h.is}):y.createElement(u)}}i[Mt]=a,i[Ut]=h;e:for(y=a.child;y!==null;){if(y.tag===5||y.tag===6)i.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===a)break e;for(;y.sibling===null;){if(y.return===null||y.return===a)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}a.stateNode=i;e:switch(It(i,u,h),u){case"button":case"input":case"select":case"textarea":i=!!h.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Er(a)}}return pt(a),a.flags&=-16777217,null;case 6:if(i&&a.stateNode!=null)i.memoizedProps!==h&&Er(a);else{if(typeof h!="string"&&a.stateNode===null)throw Error(r(166));if(i=J.current,Us(a)){if(i=a.stateNode,u=a.memoizedProps,h=null,y=Yt,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}i[Mt]=a,i=!!(i.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||Gb(i.nodeValue,u)),i||Ii(a)}else i=Su(i).createTextNode(h),i[Mt]=a,a.stateNode=i}return pt(a),null;case 13:if(h=a.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(y=Us(a),h!==null&&h.dehydrated!==null){if(i===null){if(!y)throw Error(r(318));if(y=a.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[Mt]=a}else Hs(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;pt(a),y=!1}else y=My(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=y),y=!0;if(!y)return a.flags&256?(Sr(a),a):(Sr(a),null)}if(Sr(a),(a.flags&128)!==0)return a.lanes=u,a;if(u=h!==null,i=i!==null&&i.memoizedState!==null,u){h=a.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool);var v=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(v=h.memoizedState.cachePool.pool),v!==y&&(h.flags|=2048)}return u!==i&&u&&(a.child.flags|=8192),cu(a,a.updateQueue),pt(a),null;case 4:return ye(),i===null&&Wd(a.stateNode.containerInfo),pt(a),null;case 10:return wr(a.type),pt(a),null;case 19:if(te(Ot),y=a.memoizedState,y===null)return pt(a),null;if(h=(a.flags&128)!==0,v=y.rendering,v===null)if(h)il(y,!1);else{if(mt!==0||i!==null&&(i.flags&128)!==0)for(i=a.child;i!==null;){if(v=au(i),v!==null){for(a.flags|=128,il(y,!1),i=v.updateQueue,a.updateQueue=i,cu(a,i),a.subtreeFlags=0,i=u,u=a.child;u!==null;)Ty(u,i),u=u.sibling;return T(Ot,Ot.current&1|2),a.child}i=i.sibling}y.tail!==null&&xt()>hu&&(a.flags|=128,h=!0,il(y,!1),a.lanes=4194304)}else{if(!h)if(i=au(v),i!==null){if(a.flags|=128,h=!0,i=i.updateQueue,a.updateQueue=i,cu(a,i),il(y,!0),y.tail===null&&y.tailMode==="hidden"&&!v.alternate&&!Ke)return pt(a),null}else 2*xt()-y.renderingStartTime>hu&&u!==536870912&&(a.flags|=128,h=!0,il(y,!1),a.lanes=4194304);y.isBackwards?(v.sibling=a.child,a.child=v):(i=y.last,i!==null?i.sibling=v:a.child=v,y.last=v)}return y.tail!==null?(a=y.tail,y.rendering=a,y.tail=a.sibling,y.renderingStartTime=xt(),a.sibling=null,i=Ot.current,T(Ot,h?i&1|2:i&1),a):(pt(a),null);case 22:case 23:return Sr(a),td(),h=a.memoizedState!==null,i!==null?i.memoizedState!==null!==h&&(a.flags|=8192):h&&(a.flags|=8192),h?(u&536870912)!==0&&(a.flags&128)===0&&(pt(a),a.subtreeFlags&6&&(a.flags|=8192)):pt(a),u=a.updateQueue,u!==null&&cu(a,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),h=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),h!==u&&(a.flags|=2048),i!==null&&te(Pi),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),a.memoizedState.cache!==u&&(a.flags|=2048),wr(Ct),pt(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function SA(i,a){switch(Uf(a),a.tag){case 1:return i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 3:return wr(Ct),ye(),i=a.flags,(i&65536)!==0&&(i&128)===0?(a.flags=i&-65537|128,a):null;case 26:case 27:case 5:return Se(a),null;case 13:if(Sr(a),i=a.memoizedState,i!==null&&i.dehydrated!==null){if(a.alternate===null)throw Error(r(340));Hs()}return i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 19:return te(Ot),null;case 4:return ye(),null;case 10:return wr(a.type),null;case 22:case 23:return Sr(a),td(),i!==null&&te(Pi),i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 24:return wr(Ct),null;case 25:return null;default:return null}}function eb(i,a){switch(Uf(a),a.tag){case 3:wr(Ct),ye();break;case 26:case 27:case 5:Se(a);break;case 4:ye();break;case 13:Sr(a);break;case 19:te(Ot);break;case 10:wr(a.type);break;case 22:case 23:Sr(a),td(),i!==null&&te(Pi);break;case 24:wr(Ct)}}function al(i,a){try{var u=a.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var y=h.next;u=y;do{if((u.tag&i)===i){h=void 0;var v=u.create,C=u.inst;h=v(),C.destroy=h}u=u.next}while(u!==y)}}catch(z){at(a,a.return,z)}}function Jr(i,a,u){try{var h=a.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var v=y.next;h=v;do{if((h.tag&i)===i){var C=h.inst,z=C.destroy;if(z!==void 0){C.destroy=void 0,y=a;var Z=u,re=z;try{re()}catch(oe){at(y,Z,oe)}}}h=h.next}while(h!==v)}}catch(oe){at(a,a.return,oe)}}function tb(i){var a=i.updateQueue;if(a!==null){var u=i.stateNode;try{Hy(a,u)}catch(h){at(i,i.return,h)}}}function nb(i,a,u){u.props=Hi(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(h){at(i,a,h)}}function sl(i,a){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var h=i.stateNode;break;case 30:h=i.stateNode;break;default:h=i.stateNode}typeof u=="function"?i.refCleanup=u(h):u.current=h}}catch(y){at(i,a,y)}}function tr(i,a){var u=i.ref,h=i.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(y){at(i,a,y)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){at(i,a,y)}else u.current=null}function rb(i){var a=i.type,u=i.memoizedProps,h=i.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(y){at(i,i.return,y)}}function Cd(i,a,u){try{var h=i.stateNode;VA(h,i.type,u,a),h[Ut]=a}catch(y){at(i,i.return,y)}}function ib(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&si(i.type)||i.tag===4}function Od(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||ib(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&si(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Md(i,a,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,a?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,a):(a=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,a.appendChild(i),u=u._reactRootContainer,u!=null||a.onclick!==null||(a.onclick=_u));else if(h!==4&&(h===27&&si(i.type)&&(u=i.stateNode,a=null),i=i.child,i!==null))for(Md(i,a,u),i=i.sibling;i!==null;)Md(i,a,u),i=i.sibling}function fu(i,a,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,a?u.insertBefore(i,a):u.appendChild(i);else if(h!==4&&(h===27&&si(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(fu(i,a,u),i=i.sibling;i!==null;)fu(i,a,u),i=i.sibling}function ab(i){var a=i.stateNode,u=i.memoizedProps;try{for(var h=i.type,y=a.attributes;y.length;)a.removeAttributeNode(y[0]);It(a,h,u),a[Mt]=i,a[Ut]=u}catch(v){at(i,i.return,v)}}var Ar=!1,vt=!1,Rd=!1,sb=typeof WeakSet=="function"?WeakSet:Set,Dt=null;function kA(i,a){if(i=i.containerInfo,nh=Cu,i=yy(i),Of(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var y=h.anchorOffset,v=h.focusNode;h=h.focusOffset;try{u.nodeType,v.nodeType}catch{u=null;break e}var C=0,z=-1,Z=-1,re=0,oe=0,de=i,ie=null;t:for(;;){for(var ae;de!==u||y!==0&&de.nodeType!==3||(z=C+y),de!==v||h!==0&&de.nodeType!==3||(Z=C+h),de.nodeType===3&&(C+=de.nodeValue.length),(ae=de.firstChild)!==null;)ie=de,de=ae;for(;;){if(de===i)break t;if(ie===u&&++re===y&&(z=C),ie===v&&++oe===h&&(Z=C),(ae=de.nextSibling)!==null)break;de=ie,ie=de.parentNode}de=ae}u=z===-1||Z===-1?null:{start:z,end:Z}}else u=null}u=u||{start:0,end:0}}else u=null;for(rh={focusedElem:i,selectionRange:u},Cu=!1,Dt=a;Dt!==null;)if(a=Dt,i=a.child,(a.subtreeFlags&1024)!==0&&i!==null)i.return=a,Dt=i;else for(;Dt!==null;){switch(a=Dt,v=a.alternate,i=a.flags,a.tag){case 0:break;case 11:case 15:break;case 1:if((i&1024)!==0&&v!==null){i=void 0,u=a,y=v.memoizedProps,v=v.memoizedState,h=u.stateNode;try{var Re=Hi(u.type,y,u.elementType===u.type);i=h.getSnapshotBeforeUpdate(Re,v),h.__reactInternalSnapshotBeforeUpdate=i}catch(Oe){at(u,u.return,Oe)}}break;case 3:if((i&1024)!==0){if(i=a.stateNode.containerInfo,u=i.nodeType,u===9)sh(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":sh(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=a.sibling,i!==null){i.return=a.return,Dt=i;break}Dt=a.return}}function lb(i,a,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:Wr(i,u),h&4&&al(5,u);break;case 1:if(Wr(i,u),h&4)if(i=u.stateNode,a===null)try{i.componentDidMount()}catch(C){at(u,u.return,C)}else{var y=Hi(u.type,a.memoizedProps);a=a.memoizedState;try{i.componentDidUpdate(y,a,i.__reactInternalSnapshotBeforeUpdate)}catch(C){at(u,u.return,C)}}h&64&&tb(u),h&512&&sl(u,u.return);break;case 3:if(Wr(i,u),h&64&&(i=u.updateQueue,i!==null)){if(a=null,u.child!==null)switch(u.child.tag){case 27:case 5:a=u.child.stateNode;break;case 1:a=u.child.stateNode}try{Hy(i,a)}catch(C){at(u,u.return,C)}}break;case 27:a===null&&h&4&&ab(u);case 26:case 5:Wr(i,u),a===null&&h&4&&rb(u),h&512&&sl(u,u.return);break;case 12:Wr(i,u);break;case 13:Wr(i,u),h&4&&cb(i,u),h&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=DA.bind(null,u),KA(i,u))));break;case 22:if(h=u.memoizedState!==null||Ar,!h){a=a!==null&&a.memoizedState!==null||vt,y=Ar;var v=vt;Ar=h,(vt=a)&&!v?ei(i,u,(u.subtreeFlags&8772)!==0):Wr(i,u),Ar=y,vt=v}break;case 30:break;default:Wr(i,u)}}function ob(i){var a=i.alternate;a!==null&&(i.alternate=null,ob(a)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(a=i.stateNode,a!==null&&Ts(a)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var dt=null,nn=!1;function Tr(i,a,u){for(u=u.child;u!==null;)ub(i,a,u),u=u.sibling}function ub(i,a,u){if(he&&typeof he.onCommitFiberUnmount=="function")try{he.onCommitFiberUnmount(se,u)}catch{}switch(u.tag){case 26:vt||tr(u,a),Tr(i,a,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:vt||tr(u,a);var h=dt,y=nn;si(u.type)&&(dt=u.stateNode,nn=!1),Tr(i,a,u),gl(u.stateNode),dt=h,nn=y;break;case 5:vt||tr(u,a);case 6:if(h=dt,y=nn,dt=null,Tr(i,a,u),dt=h,nn=y,dt!==null)if(nn)try{(dt.nodeType===9?dt.body:dt.nodeName==="HTML"?dt.ownerDocument.body:dt).removeChild(u.stateNode)}catch(v){at(u,a,v)}else try{dt.removeChild(u.stateNode)}catch(v){at(u,a,v)}break;case 18:dt!==null&&(nn?(i=dt,Kb(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),Sl(i)):Kb(dt,u.stateNode));break;case 4:h=dt,y=nn,dt=u.stateNode.containerInfo,nn=!0,Tr(i,a,u),dt=h,nn=y;break;case 0:case 11:case 14:case 15:vt||Jr(2,u,a),vt||Jr(4,u,a),Tr(i,a,u);break;case 1:vt||(tr(u,a),h=u.stateNode,typeof h.componentWillUnmount=="function"&&nb(u,a,h)),Tr(i,a,u);break;case 21:Tr(i,a,u);break;case 22:vt=(h=vt)||u.memoizedState!==null,Tr(i,a,u),vt=h;break;default:Tr(i,a,u)}}function cb(i,a){if(a.memoizedState===null&&(i=a.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Sl(i)}catch(u){at(a,a.return,u)}}function EA(i){switch(i.tag){case 13:case 19:var a=i.stateNode;return a===null&&(a=i.stateNode=new sb),a;case 22:return i=i.stateNode,a=i._retryCache,a===null&&(a=i._retryCache=new sb),a;default:throw Error(r(435,i.tag))}}function Dd(i,a){var u=EA(i);a.forEach(function(h){var y=jA.bind(null,i,h);u.has(h)||(u.add(h),h.then(y,y))})}function dn(i,a){var u=a.deletions;if(u!==null)for(var h=0;h<u.length;h++){var y=u[h],v=i,C=a,z=C;e:for(;z!==null;){switch(z.tag){case 27:if(si(z.type)){dt=z.stateNode,nn=!1;break e}break;case 5:dt=z.stateNode,nn=!1;break e;case 3:case 4:dt=z.stateNode.containerInfo,nn=!0;break e}z=z.return}if(dt===null)throw Error(r(160));ub(v,C,y),dt=null,nn=!1,v=y.alternate,v!==null&&(v.return=null),y.return=null}if(a.subtreeFlags&13878)for(a=a.child;a!==null;)fb(a,i),a=a.sibling}var In=null;function fb(i,a){var u=i.alternate,h=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:dn(a,i),hn(i),h&4&&(Jr(3,i,i.return),al(3,i),Jr(5,i,i.return));break;case 1:dn(a,i),hn(i),h&512&&(vt||u===null||tr(u,u.return)),h&64&&Ar&&(i=i.updateQueue,i!==null&&(h=i.callbacks,h!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var y=In;if(dn(a,i),hn(i),h&512&&(vt||u===null||tr(u,u.return)),h&4){var v=u!==null?u.memoizedState:null;if(h=i.memoizedState,u===null)if(h===null)if(i.stateNode===null){e:{h=i.type,u=i.memoizedProps,y=y.ownerDocument||y;t:switch(h){case"title":v=y.getElementsByTagName("title")[0],(!v||v[Ci]||v[Mt]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=y.createElement(h),y.head.insertBefore(v,y.querySelector("head > title"))),It(v,h,u),v[Mt]=i,_t(v),h=v;break e;case"link":var C=av("link","href",y).get(h+(u.href||""));if(C){for(var z=0;z<C.length;z++)if(v=C[z],v.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&v.getAttribute("rel")===(u.rel==null?null:u.rel)&&v.getAttribute("title")===(u.title==null?null:u.title)&&v.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){C.splice(z,1);break t}}v=y.createElement(h),It(v,h,u),y.head.appendChild(v);break;case"meta":if(C=av("meta","content",y).get(h+(u.content||""))){for(z=0;z<C.length;z++)if(v=C[z],v.getAttribute("content")===(u.content==null?null:""+u.content)&&v.getAttribute("name")===(u.name==null?null:u.name)&&v.getAttribute("property")===(u.property==null?null:u.property)&&v.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&v.getAttribute("charset")===(u.charSet==null?null:u.charSet)){C.splice(z,1);break t}}v=y.createElement(h),It(v,h,u),y.head.appendChild(v);break;default:throw Error(r(468,h))}v[Mt]=i,_t(v),h=v}i.stateNode=h}else sv(y,i.type,i.stateNode);else i.stateNode=iv(y,h,i.memoizedProps);else v!==h?(v===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):v.count--,h===null?sv(y,i.type,i.stateNode):iv(y,h,i.memoizedProps)):h===null&&i.stateNode!==null&&Cd(i,i.memoizedProps,u.memoizedProps)}break;case 27:dn(a,i),hn(i),h&512&&(vt||u===null||tr(u,u.return)),u!==null&&h&4&&Cd(i,i.memoizedProps,u.memoizedProps);break;case 5:if(dn(a,i),hn(i),h&512&&(vt||u===null||tr(u,u.return)),i.flags&32){y=i.stateNode;try{ga(y,"")}catch(ae){at(i,i.return,ae)}}h&4&&i.stateNode!=null&&(y=i.memoizedProps,Cd(i,y,u!==null?u.memoizedProps:y)),h&1024&&(Rd=!0);break;case 6:if(dn(a,i),hn(i),h&4){if(i.stateNode===null)throw Error(r(162));h=i.memoizedProps,u=i.stateNode;try{u.nodeValue=h}catch(ae){at(i,i.return,ae)}}break;case 3:if(Au=null,y=In,In=ku(a.containerInfo),dn(a,i),In=y,hn(i),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Sl(a.containerInfo)}catch(ae){at(i,i.return,ae)}Rd&&(Rd=!1,db(i));break;case 4:h=In,In=ku(i.stateNode.containerInfo),dn(a,i),hn(i),In=h;break;case 12:dn(a,i),hn(i);break;case 13:dn(a,i),hn(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Fd=xt()),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,Dd(i,h)));break;case 22:y=i.memoizedState!==null;var Z=u!==null&&u.memoizedState!==null,re=Ar,oe=vt;if(Ar=re||y,vt=oe||Z,dn(a,i),vt=oe,Ar=re,hn(i),h&8192)e:for(a=i.stateNode,a._visibility=y?a._visibility&-2:a._visibility|1,y&&(u===null||Z||Ar||vt||$i(i)),u=null,a=i;;){if(a.tag===5||a.tag===26){if(u===null){Z=u=a;try{if(v=Z.stateNode,y)C=v.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{z=Z.stateNode;var de=Z.memoizedProps.style,ie=de!=null&&de.hasOwnProperty("display")?de.display:null;z.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(ae){at(Z,Z.return,ae)}}}else if(a.tag===6){if(u===null){Z=a;try{Z.stateNode.nodeValue=y?"":Z.memoizedProps}catch(ae){at(Z,Z.return,ae)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===i)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break e;for(;a.sibling===null;){if(a.return===null||a.return===i)break e;u===a&&(u=null),a=a.return}u===a&&(u=null),a.sibling.return=a.return,a=a.sibling}h&4&&(h=i.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,Dd(i,u))));break;case 19:dn(a,i),hn(i),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,Dd(i,h)));break;case 30:break;case 21:break;default:dn(a,i),hn(i)}}function hn(i){var a=i.flags;if(a&2){try{for(var u,h=i.return;h!==null;){if(ib(h)){u=h;break}h=h.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var y=u.stateNode,v=Od(i);fu(i,v,y);break;case 5:var C=u.stateNode;u.flags&32&&(ga(C,""),u.flags&=-33);var z=Od(i);fu(i,z,C);break;case 3:case 4:var Z=u.stateNode.containerInfo,re=Od(i);Md(i,re,Z);break;default:throw Error(r(161))}}catch(oe){at(i,i.return,oe)}i.flags&=-3}a&4096&&(i.flags&=-4097)}function db(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var a=i;db(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),i=i.sibling}}function Wr(i,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)lb(i,a.alternate,a),a=a.sibling}function $i(i){for(i=i.child;i!==null;){var a=i;switch(a.tag){case 0:case 11:case 14:case 15:Jr(4,a,a.return),$i(a);break;case 1:tr(a,a.return);var u=a.stateNode;typeof u.componentWillUnmount=="function"&&nb(a,a.return,u),$i(a);break;case 27:gl(a.stateNode);case 26:case 5:tr(a,a.return),$i(a);break;case 22:a.memoizedState===null&&$i(a);break;case 30:$i(a);break;default:$i(a)}i=i.sibling}}function ei(i,a,u){for(u=u&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var h=a.alternate,y=i,v=a,C=v.flags;switch(v.tag){case 0:case 11:case 15:ei(y,v,u),al(4,v);break;case 1:if(ei(y,v,u),h=v,y=h.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(re){at(h,h.return,re)}if(h=v,y=h.updateQueue,y!==null){var z=h.stateNode;try{var Z=y.shared.hiddenCallbacks;if(Z!==null)for(y.shared.hiddenCallbacks=null,y=0;y<Z.length;y++)Uy(Z[y],z)}catch(re){at(h,h.return,re)}}u&&C&64&&tb(v),sl(v,v.return);break;case 27:ab(v);case 26:case 5:ei(y,v,u),u&&h===null&&C&4&&rb(v),sl(v,v.return);break;case 12:ei(y,v,u);break;case 13:ei(y,v,u),u&&C&4&&cb(y,v);break;case 22:v.memoizedState===null&&ei(y,v,u),sl(v,v.return);break;case 30:break;default:ei(y,v,u)}a=a.sibling}}function jd(i,a){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(i=a.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&qs(u))}function zd(i,a){i=null,a.alternate!==null&&(i=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==i&&(a.refCount++,i!=null&&qs(i))}function nr(i,a,u,h){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)hb(i,a,u,h),a=a.sibling}function hb(i,a,u,h){var y=a.flags;switch(a.tag){case 0:case 11:case 15:nr(i,a,u,h),y&2048&&al(9,a);break;case 1:nr(i,a,u,h);break;case 3:nr(i,a,u,h),y&2048&&(i=null,a.alternate!==null&&(i=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==i&&(a.refCount++,i!=null&&qs(i)));break;case 12:if(y&2048){nr(i,a,u,h),i=a.stateNode;try{var v=a.memoizedProps,C=v.id,z=v.onPostCommit;typeof z=="function"&&z(C,a.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(Z){at(a,a.return,Z)}}else nr(i,a,u,h);break;case 13:nr(i,a,u,h);break;case 23:break;case 22:v=a.stateNode,C=a.alternate,a.memoizedState!==null?v._visibility&2?nr(i,a,u,h):ll(i,a):v._visibility&2?nr(i,a,u,h):(v._visibility|=2,ja(i,a,u,h,(a.subtreeFlags&10256)!==0)),y&2048&&jd(C,a);break;case 24:nr(i,a,u,h),y&2048&&zd(a.alternate,a);break;default:nr(i,a,u,h)}}function ja(i,a,u,h,y){for(y=y&&(a.subtreeFlags&10256)!==0,a=a.child;a!==null;){var v=i,C=a,z=u,Z=h,re=C.flags;switch(C.tag){case 0:case 11:case 15:ja(v,C,z,Z,y),al(8,C);break;case 23:break;case 22:var oe=C.stateNode;C.memoizedState!==null?oe._visibility&2?ja(v,C,z,Z,y):ll(v,C):(oe._visibility|=2,ja(v,C,z,Z,y)),y&&re&2048&&jd(C.alternate,C);break;case 24:ja(v,C,z,Z,y),y&&re&2048&&zd(C.alternate,C);break;default:ja(v,C,z,Z,y)}a=a.sibling}}function ll(i,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var u=i,h=a,y=h.flags;switch(h.tag){case 22:ll(u,h),y&2048&&jd(h.alternate,h);break;case 24:ll(u,h),y&2048&&zd(h.alternate,h);break;default:ll(u,h)}a=a.sibling}}var ol=8192;function za(i){if(i.subtreeFlags&ol)for(i=i.child;i!==null;)pb(i),i=i.sibling}function pb(i){switch(i.tag){case 26:za(i),i.flags&ol&&i.memoizedState!==null&&cT(In,i.memoizedState,i.memoizedProps);break;case 5:za(i);break;case 3:case 4:var a=In;In=ku(i.stateNode.containerInfo),za(i),In=a;break;case 22:i.memoizedState===null&&(a=i.alternate,a!==null&&a.memoizedState!==null?(a=ol,ol=16777216,za(i),ol=a):za(i));break;default:za(i)}}function gb(i){var a=i.alternate;if(a!==null&&(i=a.child,i!==null)){a.child=null;do a=i.sibling,i.sibling=null,i=a;while(i!==null)}}function ul(i){var a=i.deletions;if((i.flags&16)!==0){if(a!==null)for(var u=0;u<a.length;u++){var h=a[u];Dt=h,yb(h,i)}gb(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)mb(i),i=i.sibling}function mb(i){switch(i.tag){case 0:case 11:case 15:ul(i),i.flags&2048&&Jr(9,i,i.return);break;case 3:ul(i);break;case 12:ul(i);break;case 22:var a=i.stateNode;i.memoizedState!==null&&a._visibility&2&&(i.return===null||i.return.tag!==13)?(a._visibility&=-3,du(i)):ul(i);break;default:ul(i)}}function du(i){var a=i.deletions;if((i.flags&16)!==0){if(a!==null)for(var u=0;u<a.length;u++){var h=a[u];Dt=h,yb(h,i)}gb(i)}for(i=i.child;i!==null;){switch(a=i,a.tag){case 0:case 11:case 15:Jr(8,a,a.return),du(a);break;case 22:u=a.stateNode,u._visibility&2&&(u._visibility&=-3,du(a));break;default:du(a)}i=i.sibling}}function yb(i,a){for(;Dt!==null;){var u=Dt;switch(u.tag){case 0:case 11:case 15:Jr(8,u,a);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:qs(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,Dt=h;else e:for(u=i;Dt!==null;){h=Dt;var y=h.sibling,v=h.return;if(ob(h),h===u){Dt=null;break e}if(y!==null){y.return=v,Dt=y;break e}Dt=v}}}var AA={getCacheForType:function(i){var a=Ht(Ct),u=a.data.get(i);return u===void 0&&(u=i(),a.data.set(i,u)),u}},TA=typeof WeakMap=="function"?WeakMap:Map,We=0,ot=null,Ue=null,Ve=0,et=0,pn=null,ti=!1,La=!1,Ld=!1,Nr=0,mt=0,ni=0,Vi=0,Id=0,Cn=0,Ia=0,cl=null,rn=null,Bd=!1,Fd=0,hu=1/0,pu=null,ri=null,Lt=0,ii=null,Ba=null,Fa=0,Pd=0,Ud=null,bb=null,fl=0,Hd=null;function gn(){if((We&2)!==0&&Ve!==0)return Ve&-Ve;if(I.T!==null){var i=Aa;return i!==0?i:Xd()}return xo()}function vb(){Cn===0&&(Cn=(Ve&536870912)===0||Ke?yo():536870912);var i=Nn.current;return i!==null&&(i.flags|=32),Cn}function mn(i,a,u){(i===ot&&(et===2||et===9)||i.cancelPendingCommit!==null)&&(Pa(i,0),ai(i,Ve,Cn,!1)),Ni(i,u),((We&2)===0||i!==ot)&&(i===ot&&((We&2)===0&&(Vi|=u),mt===4&&ai(i,Ve,Cn,!1)),rr(i))}function xb(i,a,u){if((We&6)!==0)throw Error(r(327));var h=!u&&(a&124)===0&&(a&i.expiredLanes)===0||Kt(i,a),y=h?OA(i,a):qd(i,a,!0),v=h;do{if(y===0){La&&!h&&ai(i,a,0,!1);break}else{if(u=i.current.alternate,v&&!NA(u)){y=qd(i,a,!1),v=!1;continue}if(y===2){if(v=a,i.errorRecoveryDisabledLanes&v)var C=0;else C=i.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){a=C;e:{var z=i;y=cl;var Z=z.current.memoizedState.isDehydrated;if(Z&&(Pa(z,C).flags|=256),C=qd(z,C,!1),C!==2){if(Ld&&!Z){z.errorRecoveryDisabledLanes|=v,Vi|=v,y=4;break e}v=rn,rn=y,v!==null&&(rn===null?rn=v:rn.push.apply(rn,v))}y=C}if(v=!1,y!==2)continue}}if(y===1){Pa(i,0),ai(i,a,0,!0);break}e:{switch(h=i,v=y,v){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a)break;case 6:ai(h,a,Cn,!ti);break e;case 2:rn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(y=Fd+300-xt(),10<y)){if(ai(h,a,Cn,!ti),wt(h,0,!0)!==0)break e;h.timeoutHandle=Xb(wb.bind(null,h,u,rn,pu,Bd,a,Cn,Vi,Ia,ti,v,2,-0,0),y);break e}wb(h,u,rn,pu,Bd,a,Cn,Vi,Ia,ti,v,0,-0,0)}}break}while(!0);rr(i)}function wb(i,a,u,h,y,v,C,z,Z,re,oe,de,ie,ae){if(i.timeoutHandle=-1,de=a.subtreeFlags,(de&8192||(de&16785408)===16785408)&&(bl={stylesheets:null,count:0,unsuspend:uT},pb(a),de=fT(),de!==null)){i.cancelPendingCommit=de(Nb.bind(null,i,a,v,u,h,y,C,z,Z,oe,1,ie,ae)),ai(i,v,C,!re);return}Nb(i,a,v,u,h,y,C,z,Z)}function NA(i){for(var a=i;;){var u=a.tag;if((u===0||u===11||u===15)&&a.flags&16384&&(u=a.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var y=u[h],v=y.getSnapshot;y=y.value;try{if(!cn(v(),y))return!1}catch{return!1}}if(u=a.child,a.subtreeFlags&16384&&u!==null)u.return=a,a=u;else{if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function ai(i,a,u,h){a&=~Id,a&=~Vi,i.suspendedLanes|=a,i.pingedLanes&=~a,h&&(i.warmLanes|=a),h=i.expirationTimes;for(var y=a;0<y;){var v=31-Te(y),C=1<<v;h[v]=-1,y&=~C}u!==0&&Ss(i,u,a)}function gu(){return(We&6)===0?(dl(0),!1):!0}function $d(){if(Ue!==null){if(et===0)var i=Ue.return;else i=Ue,xr=Bi=null,sd(i),Ra=null,nl=0,i=Ue;for(;i!==null;)eb(i.alternate,i),i=i.return;Ue=null}}function Pa(i,a){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,GA(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),$d(),ot=i,Ue=u=yr(i.current,null),Ve=a,et=0,pn=null,ti=!1,La=Kt(i,a),Ld=!1,Ia=Cn=Id=Vi=ni=mt=0,rn=cl=null,Bd=!1,(a&8)!==0&&(a|=a&32);var h=i.entangledLanes;if(h!==0)for(i=i.entanglements,h&=a;0<h;){var y=31-Te(h),v=1<<y;a|=i[y],h&=~v}return Nr=a,Io(),u}function _b(i,a){Be=null,I.H=nu,a===Zs||a===Go?(a=Fy(),et=3):a===Ly?(a=Fy(),et=4):et=a===P0?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,pn=a,Ue===null&&(mt=1,lu(i,kn(a,i.current)))}function Sb(){var i=I.H;return I.H=nu,i===null?nu:i}function kb(){var i=I.A;return I.A=AA,i}function Vd(){mt=4,ti||(Ve&4194048)!==Ve&&Nn.current!==null||(La=!0),(ni&134217727)===0&&(Vi&134217727)===0||ot===null||ai(ot,Ve,Cn,!1)}function qd(i,a,u){var h=We;We|=2;var y=Sb(),v=kb();(ot!==i||Ve!==a)&&(pu=null,Pa(i,a)),a=!1;var C=mt;e:do try{if(et!==0&&Ue!==null){var z=Ue,Z=pn;switch(et){case 8:$d(),C=6;break e;case 3:case 2:case 9:case 6:Nn.current===null&&(a=!0);var re=et;if(et=0,pn=null,Ua(i,z,Z,re),u&&La){C=0;break e}break;default:re=et,et=0,pn=null,Ua(i,z,Z,re)}}CA(),C=mt;break}catch(oe){_b(i,oe)}while(!0);return a&&i.shellSuspendCounter++,xr=Bi=null,We=h,I.H=y,I.A=v,Ue===null&&(ot=null,Ve=0,Io()),C}function CA(){for(;Ue!==null;)Eb(Ue)}function OA(i,a){var u=We;We|=2;var h=Sb(),y=kb();ot!==i||Ve!==a?(pu=null,hu=xt()+500,Pa(i,a)):La=Kt(i,a);e:do try{if(et!==0&&Ue!==null){a=Ue;var v=pn;t:switch(et){case 1:et=0,pn=null,Ua(i,a,v,1);break;case 2:case 9:if(Iy(v)){et=0,pn=null,Ab(a);break}a=function(){et!==2&&et!==9||ot!==i||(et=7),rr(i)},v.then(a,a);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:Iy(v)?(et=0,pn=null,Ab(a)):(et=0,pn=null,Ua(i,a,v,7));break;case 5:var C=null;switch(Ue.tag){case 26:C=Ue.memoizedState;case 5:case 27:var z=Ue;if(!C||lv(C)){et=0,pn=null;var Z=z.sibling;if(Z!==null)Ue=Z;else{var re=z.return;re!==null?(Ue=re,mu(re)):Ue=null}break t}}et=0,pn=null,Ua(i,a,v,5);break;case 6:et=0,pn=null,Ua(i,a,v,6);break;case 8:$d(),mt=6;break e;default:throw Error(r(462))}}MA();break}catch(oe){_b(i,oe)}while(!0);return xr=Bi=null,I.H=h,I.A=y,We=u,Ue!==null?0:(ot=null,Ve=0,Io(),mt)}function MA(){for(;Ue!==null&&!lt();)Eb(Ue)}function Eb(i){var a=J0(i.alternate,i,Nr);i.memoizedProps=i.pendingProps,a===null?mu(i):Ue=a}function Ab(i){var a=i,u=a.alternate;switch(a.tag){case 15:case 0:a=G0(u,a,a.pendingProps,a.type,void 0,Ve);break;case 11:a=G0(u,a,a.pendingProps,a.type.render,a.ref,Ve);break;case 5:sd(a);default:eb(u,a),a=Ue=Ty(a,Nr),a=J0(u,a,Nr)}i.memoizedProps=i.pendingProps,a===null?mu(i):Ue=a}function Ua(i,a,u,h){xr=Bi=null,sd(a),Ra=null,nl=0;var y=a.return;try{if(xA(i,y,a,u,Ve)){mt=1,lu(i,kn(u,i.current)),Ue=null;return}}catch(v){if(y!==null)throw Ue=y,v;mt=1,lu(i,kn(u,i.current)),Ue=null;return}a.flags&32768?(Ke||h===1?i=!0:La||(Ve&536870912)!==0?i=!1:(ti=i=!0,(h===2||h===9||h===3||h===6)&&(h=Nn.current,h!==null&&h.tag===13&&(h.flags|=16384))),Tb(a,i)):mu(a)}function mu(i){var a=i;do{if((a.flags&32768)!==0){Tb(a,ti);return}i=a.return;var u=_A(a.alternate,a,Nr);if(u!==null){Ue=u;return}if(a=a.sibling,a!==null){Ue=a;return}Ue=a=i}while(a!==null);mt===0&&(mt=5)}function Tb(i,a){do{var u=SA(i.alternate,i);if(u!==null){u.flags&=32767,Ue=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!a&&(i=i.sibling,i!==null)){Ue=i;return}Ue=i=u}while(i!==null);mt=6,Ue=null}function Nb(i,a,u,h,y,v,C,z,Z){i.cancelPendingCommit=null;do yu();while(Lt!==0);if((We&6)!==0)throw Error(r(327));if(a!==null){if(a===i.current)throw Error(r(177));if(v=a.lanes|a.childLanes,v|=zf,uf(i,u,v,C,z,Z),i===ot&&(Ue=ot=null,Ve=0),Ba=a,ii=i,Fa=u,Pd=v,Ud=y,bb=h,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,zA(Xn,function(){return Db(),null})):(i.callbackNode=null,i.callbackPriority=0),h=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||h){h=I.T,I.T=null,y=P.p,P.p=2,C=We,We|=4;try{kA(i,a,u)}finally{We=C,P.p=y,I.T=h}}Lt=1,Cb(),Ob(),Mb()}}function Cb(){if(Lt===1){Lt=0;var i=ii,a=Ba,u=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||u){u=I.T,I.T=null;var h=P.p;P.p=2;var y=We;We|=4;try{fb(a,i);var v=rh,C=yy(i.containerInfo),z=v.focusedElem,Z=v.selectionRange;if(C!==z&&z&&z.ownerDocument&&my(z.ownerDocument.documentElement,z)){if(Z!==null&&Of(z)){var re=Z.start,oe=Z.end;if(oe===void 0&&(oe=re),"selectionStart"in z)z.selectionStart=re,z.selectionEnd=Math.min(oe,z.value.length);else{var de=z.ownerDocument||document,ie=de&&de.defaultView||window;if(ie.getSelection){var ae=ie.getSelection(),Re=z.textContent.length,Oe=Math.min(Z.start,Re),it=Z.end===void 0?Oe:Math.min(Z.end,Re);!ae.extend&&Oe>it&&(C=it,it=Oe,Oe=C);var ee=gy(z,Oe),Q=gy(z,it);if(ee&&Q&&(ae.rangeCount!==1||ae.anchorNode!==ee.node||ae.anchorOffset!==ee.offset||ae.focusNode!==Q.node||ae.focusOffset!==Q.offset)){var ne=de.createRange();ne.setStart(ee.node,ee.offset),ae.removeAllRanges(),Oe>it?(ae.addRange(ne),ae.extend(Q.node,Q.offset)):(ne.setEnd(Q.node,Q.offset),ae.addRange(ne))}}}}for(de=[],ae=z;ae=ae.parentNode;)ae.nodeType===1&&de.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<de.length;z++){var ue=de[z];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}Cu=!!nh,rh=nh=null}finally{We=y,P.p=h,I.T=u}}i.current=a,Lt=2}}function Ob(){if(Lt===2){Lt=0;var i=ii,a=Ba,u=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||u){u=I.T,I.T=null;var h=P.p;P.p=2;var y=We;We|=4;try{lb(i,a.alternate,a)}finally{We=y,P.p=h,I.T=u}}Lt=3}}function Mb(){if(Lt===4||Lt===3){Lt=0,ft();var i=ii,a=Ba,u=Fa,h=bb;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?Lt=5:(Lt=0,Ba=ii=null,Rb(i,i.pendingLanes));var y=i.pendingLanes;if(y===0&&(ri=null),Es(u),a=a.stateNode,he&&typeof he.onCommitFiberRoot=="function")try{he.onCommitFiberRoot(se,a,void 0,(a.current.flags&128)===128)}catch{}if(h!==null){a=I.T,y=P.p,P.p=2,I.T=null;try{for(var v=i.onRecoverableError,C=0;C<h.length;C++){var z=h[C];v(z.value,{componentStack:z.stack})}}finally{I.T=a,P.p=y}}(Fa&3)!==0&&yu(),rr(i),y=i.pendingLanes,(u&4194090)!==0&&(y&42)!==0?i===Hd?fl++:(fl=0,Hd=i):fl=0,dl(0)}}function Rb(i,a){(i.pooledCacheLanes&=a)===0&&(a=i.pooledCache,a!=null&&(i.pooledCache=null,qs(a)))}function yu(i){return Cb(),Ob(),Mb(),Db()}function Db(){if(Lt!==5)return!1;var i=ii,a=Pd;Pd=0;var u=Es(Fa),h=I.T,y=P.p;try{P.p=32>u?32:u,I.T=null,u=Ud,Ud=null;var v=ii,C=Fa;if(Lt=0,Ba=ii=null,Fa=0,(We&6)!==0)throw Error(r(331));var z=We;if(We|=4,mb(v.current),hb(v,v.current,C,u),We=z,dl(0,!1),he&&typeof he.onPostCommitFiberRoot=="function")try{he.onPostCommitFiberRoot(se,v)}catch{}return!0}finally{P.p=y,I.T=h,Rb(i,a)}}function jb(i,a,u){a=kn(u,a),a=xd(i.stateNode,a,2),i=Yr(i,a,2),i!==null&&(Ni(i,2),rr(i))}function at(i,a,u){if(i.tag===3)jb(i,i,u);else for(;a!==null;){if(a.tag===3){jb(a,i,u);break}else if(a.tag===1){var h=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(ri===null||!ri.has(h))){i=kn(u,i),u=B0(2),h=Yr(a,u,2),h!==null&&(F0(u,h,a,i),Ni(h,2),rr(h));break}}a=a.return}}function Gd(i,a,u){var h=i.pingCache;if(h===null){h=i.pingCache=new TA;var y=new Set;h.set(a,y)}else y=h.get(a),y===void 0&&(y=new Set,h.set(a,y));y.has(u)||(Ld=!0,y.add(u),i=RA.bind(null,i,a,u),a.then(i,i))}function RA(i,a,u){var h=i.pingCache;h!==null&&h.delete(a),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,ot===i&&(Ve&u)===u&&(mt===4||mt===3&&(Ve&62914560)===Ve&&300>xt()-Fd?(We&2)===0&&Pa(i,0):Id|=u,Ia===Ve&&(Ia=0)),rr(i)}function zb(i,a){a===0&&(a=bo()),i=_a(i,a),i!==null&&(Ni(i,a),rr(i))}function DA(i){var a=i.memoizedState,u=0;a!==null&&(u=a.retryLane),zb(i,u)}function jA(i,a){var u=0;switch(i.tag){case 13:var h=i.stateNode,y=i.memoizedState;y!==null&&(u=y.retryLane);break;case 19:h=i.stateNode;break;case 22:h=i.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(a),zb(i,u)}function zA(i,a){return je(i,a)}var bu=null,Ha=null,Zd=!1,vu=!1,Yd=!1,qi=0;function rr(i){i!==Ha&&i.next===null&&(Ha===null?bu=Ha=i:Ha=Ha.next=i),vu=!0,Zd||(Zd=!0,IA())}function dl(i,a){if(!Yd&&vu){Yd=!0;do for(var u=!1,h=bu;h!==null;){if(i!==0){var y=h.pendingLanes;if(y===0)var v=0;else{var C=h.suspendedLanes,z=h.pingedLanes;v=(1<<31-Te(42|i)+1)-1,v&=y&~(C&~z),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(u=!0,Fb(h,v))}else v=Ve,v=wt(h,h===ot?v:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(v&3)===0||Kt(h,v)||(u=!0,Fb(h,v));h=h.next}while(u);Yd=!1}}function LA(){Lb()}function Lb(){vu=Zd=!1;var i=0;qi!==0&&(qA()&&(i=qi),qi=0);for(var a=xt(),u=null,h=bu;h!==null;){var y=h.next,v=Ib(h,a);v===0?(h.next=null,u===null?bu=y:u.next=y,y===null&&(Ha=u)):(u=h,(i!==0||(v&3)!==0)&&(vu=!0)),h=y}dl(i)}function Ib(i,a){for(var u=i.suspendedLanes,h=i.pingedLanes,y=i.expirationTimes,v=i.pendingLanes&-62914561;0<v;){var C=31-Te(v),z=1<<C,Z=y[C];Z===-1?((z&u)===0||(z&h)!==0)&&(y[C]=un(z,a)):Z<=a&&(i.expiredLanes|=z),v&=~z}if(a=ot,u=Ve,u=wt(i,i===a?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h=i.callbackNode,u===0||i===a&&(et===2||et===9)||i.cancelPendingCommit!==null)return h!==null&&h!==null&&ze(h),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||Kt(i,u)){if(a=u&-u,a===i.callbackPriority)return a;switch(h!==null&&ze(h),Es(u)){case 2:case 8:u=Dn;break;case 32:u=Xn;break;case 268435456:u=Qn;break;default:u=Xn}return h=Bb.bind(null,i),u=je(u,h),i.callbackPriority=a,i.callbackNode=u,a}return h!==null&&h!==null&&ze(h),i.callbackPriority=2,i.callbackNode=null,2}function Bb(i,a){if(Lt!==0&&Lt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(yu()&&i.callbackNode!==u)return null;var h=Ve;return h=wt(i,i===ot?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h===0?null:(xb(i,h,a),Ib(i,xt()),i.callbackNode!=null&&i.callbackNode===u?Bb.bind(null,i):null)}function Fb(i,a){if(yu())return null;xb(i,a,!0)}function IA(){ZA(function(){(We&6)!==0?je(fr,LA):Lb()})}function Xd(){return qi===0&&(qi=yo()),qi}function Pb(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Oo(""+i)}function Ub(i,a){var u=a.ownerDocument.createElement("input");return u.name=a.name,u.value=a.value,i.id&&u.setAttribute("form",i.id),a.parentNode.insertBefore(u,a),i=new FormData(i),u.parentNode.removeChild(u),i}function BA(i,a,u,h,y){if(a==="submit"&&u&&u.stateNode===y){var v=Pb((y[Ut]||null).action),C=h.submitter;C&&(a=(a=C[Ut]||null)?Pb(a.formAction):C.getAttribute("formAction"),a!==null&&(v=a,C=null));var z=new jo("action","action",null,h,y);i.push({event:z,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(qi!==0){var Z=C?Ub(y,C):new FormData(y);gd(u,{pending:!0,data:Z,method:y.method,action:v},null,Z)}}else typeof v=="function"&&(z.preventDefault(),Z=C?Ub(y,C):new FormData(y),gd(u,{pending:!0,data:Z,method:y.method,action:v},v,Z))},currentTarget:y}]})}}for(var Qd=0;Qd<jf.length;Qd++){var Kd=jf[Qd],FA=Kd.toLowerCase(),PA=Kd[0].toUpperCase()+Kd.slice(1);Ln(FA,"on"+PA)}Ln(xy,"onAnimationEnd"),Ln(wy,"onAnimationIteration"),Ln(_y,"onAnimationStart"),Ln("dblclick","onDoubleClick"),Ln("focusin","onFocus"),Ln("focusout","onBlur"),Ln(rA,"onTransitionRun"),Ln(iA,"onTransitionStart"),Ln(aA,"onTransitionCancel"),Ln(Sy,"onTransitionEnd"),Ur("onMouseEnter",["mouseout","mouseover"]),Ur("onMouseLeave",["mouseout","mouseover"]),Ur("onPointerEnter",["pointerout","pointerover"]),Ur("onPointerLeave",["pointerout","pointerover"]),gr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),gr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),gr("onBeforeInput",["compositionend","keypress","textInput","paste"]),gr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),gr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),gr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),UA=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(hl));function Hb(i,a){a=(a&4)!==0;for(var u=0;u<i.length;u++){var h=i[u],y=h.event;h=h.listeners;e:{var v=void 0;if(a)for(var C=h.length-1;0<=C;C--){var z=h[C],Z=z.instance,re=z.currentTarget;if(z=z.listener,Z!==v&&y.isPropagationStopped())break e;v=z,y.currentTarget=re;try{v(y)}catch(oe){su(oe)}y.currentTarget=null,v=Z}else for(C=0;C<h.length;C++){if(z=h[C],Z=z.instance,re=z.currentTarget,z=z.listener,Z!==v&&y.isPropagationStopped())break e;v=z,y.currentTarget=re;try{v(y)}catch(oe){su(oe)}y.currentTarget=null,v=Z}}}}function He(i,a){var u=a[As];u===void 0&&(u=a[As]=new Set);var h=i+"__bubble";u.has(h)||($b(a,i,2,!1),u.add(h))}function Jd(i,a,u){var h=0;a&&(h|=4),$b(u,i,h,a)}var xu="_reactListening"+Math.random().toString(36).slice(2);function Wd(i){if(!i[xu]){i[xu]=!0,_o.forEach(function(u){u!=="selectionchange"&&(UA.has(u)||Jd(u,!1,i),Jd(u,!0,i))});var a=i.nodeType===9?i:i.ownerDocument;a===null||a[xu]||(a[xu]=!0,Jd("selectionchange",!1,a))}}function $b(i,a,u,h){switch(hv(a)){case 2:var y=pT;break;case 8:y=gT;break;default:y=hh}u=y.bind(null,a,u,i),y=void 0,!wf||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(y=!0),h?y!==void 0?i.addEventListener(a,u,{capture:!0,passive:y}):i.addEventListener(a,u,!0):y!==void 0?i.addEventListener(a,u,{passive:y}):i.addEventListener(a,u,!1)}function eh(i,a,u,h,y){var v=h;if((a&1)===0&&(a&2)===0&&h!==null)e:for(;;){if(h===null)return;var C=h.tag;if(C===3||C===4){var z=h.stateNode.containerInfo;if(z===y)break;if(C===4)for(C=h.return;C!==null;){var Z=C.tag;if((Z===3||Z===4)&&C.stateNode.containerInfo===y)return;C=C.return}for(;z!==null;){if(C=hr(z),C===null)return;if(Z=C.tag,Z===5||Z===6||Z===26||Z===27){h=v=C;continue e}z=z.parentNode}}h=h.return}Qm(function(){var re=v,oe=vf(u),de=[];e:{var ie=ky.get(i);if(ie!==void 0){var ae=jo,Re=i;switch(i){case"keypress":if(Ro(u)===0)break e;case"keydown":case"keyup":ae=z2;break;case"focusin":Re="focus",ae=Ef;break;case"focusout":Re="blur",ae=Ef;break;case"beforeblur":case"afterblur":ae=Ef;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ae=Wm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=S2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=B2;break;case xy:case wy:case _y:ae=A2;break;case Sy:ae=P2;break;case"scroll":case"scrollend":ae=w2;break;case"wheel":ae=H2;break;case"copy":case"cut":case"paste":ae=N2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=ty;break;case"toggle":case"beforetoggle":ae=V2}var Oe=(a&4)!==0,it=!Oe&&(i==="scroll"||i==="scrollend"),ee=Oe?ie!==null?ie+"Capture":null:ie;Oe=[];for(var Q=re,ne;Q!==null;){var ue=Q;if(ne=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||ne===null||ee===null||(ue=Rs(Q,ee),ue!=null&&Oe.push(pl(Q,ue,ne))),it)break;Q=Q.return}0<Oe.length&&(ie=new ae(ie,Re,null,u,oe),de.push({event:ie,listeners:Oe}))}}if((a&7)===0){e:{if(ie=i==="mouseover"||i==="pointerover",ae=i==="mouseout"||i==="pointerout",ie&&u!==bf&&(Re=u.relatedTarget||u.fromElement)&&(hr(Re)||Re[Br]))break e;if((ae||ie)&&(ie=oe.window===oe?oe:(ie=oe.ownerDocument)?ie.defaultView||ie.parentWindow:window,ae?(Re=u.relatedTarget||u.toElement,ae=re,Re=Re?hr(Re):null,Re!==null&&(it=l(Re),Oe=Re.tag,Re!==it||Oe!==5&&Oe!==27&&Oe!==6)&&(Re=null)):(ae=null,Re=re),ae!==Re)){if(Oe=Wm,ue="onMouseLeave",ee="onMouseEnter",Q="mouse",(i==="pointerout"||i==="pointerover")&&(Oe=ty,ue="onPointerLeave",ee="onPointerEnter",Q="pointer"),it=ae==null?ie:Fr(ae),ne=Re==null?ie:Fr(Re),ie=new Oe(ue,Q+"leave",ae,u,oe),ie.target=it,ie.relatedTarget=ne,ue=null,hr(oe)===re&&(Oe=new Oe(ee,Q+"enter",Re,u,oe),Oe.target=ne,Oe.relatedTarget=it,ue=Oe),it=ue,ae&&Re)t:{for(Oe=ae,ee=Re,Q=0,ne=Oe;ne;ne=$a(ne))Q++;for(ne=0,ue=ee;ue;ue=$a(ue))ne++;for(;0<Q-ne;)Oe=$a(Oe),Q--;for(;0<ne-Q;)ee=$a(ee),ne--;for(;Q--;){if(Oe===ee||ee!==null&&Oe===ee.alternate)break t;Oe=$a(Oe),ee=$a(ee)}Oe=null}else Oe=null;ae!==null&&Vb(de,ie,ae,Oe,!1),Re!==null&&it!==null&&Vb(de,it,Re,Oe,!0)}}e:{if(ie=re?Fr(re):window,ae=ie.nodeName&&ie.nodeName.toLowerCase(),ae==="select"||ae==="input"&&ie.type==="file")var xe=uy;else if(ly(ie))if(cy)xe=eA;else{xe=J2;var Fe=K2}else ae=ie.nodeName,!ae||ae.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?re&&yf(re.elementType)&&(xe=uy):xe=W2;if(xe&&(xe=xe(i,re))){oy(de,xe,u,oe);break e}Fe&&Fe(i,ie,re),i==="focusout"&&re&&ie.type==="number"&&re.memoizedProps.value!=null&&mf(ie,"number",ie.value)}switch(Fe=re?Fr(re):window,i){case"focusin":(ly(Fe)||Fe.contentEditable==="true")&&(va=Fe,Mf=re,Ps=null);break;case"focusout":Ps=Mf=va=null;break;case"mousedown":Rf=!0;break;case"contextmenu":case"mouseup":case"dragend":Rf=!1,by(de,u,oe);break;case"selectionchange":if(nA)break;case"keydown":case"keyup":by(de,u,oe)}var ke;if(Tf)e:{switch(i){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else ba?ay(i,u)&&(Me="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(Me="onCompositionStart");Me&&(ny&&u.locale!=="ko"&&(ba||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&ba&&(ke=Km()):(Vr=oe,_f="value"in Vr?Vr.value:Vr.textContent,ba=!0)),Fe=wu(re,Me),0<Fe.length&&(Me=new ey(Me,i,null,u,oe),de.push({event:Me,listeners:Fe}),ke?Me.data=ke:(ke=sy(u),ke!==null&&(Me.data=ke)))),(ke=G2?Z2(i,u):Y2(i,u))&&(Me=wu(re,"onBeforeInput"),0<Me.length&&(Fe=new ey("onBeforeInput","beforeinput",null,u,oe),de.push({event:Fe,listeners:Me}),Fe.data=ke)),BA(de,i,re,u,oe)}Hb(de,a)})}function pl(i,a,u){return{instance:i,listener:a,currentTarget:u}}function wu(i,a){for(var u=a+"Capture",h=[];i!==null;){var y=i,v=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||v===null||(y=Rs(i,u),y!=null&&h.unshift(pl(i,y,v)),y=Rs(i,a),y!=null&&h.push(pl(i,y,v))),i.tag===3)return h;i=i.return}return[]}function $a(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Vb(i,a,u,h,y){for(var v=a._reactName,C=[];u!==null&&u!==h;){var z=u,Z=z.alternate,re=z.stateNode;if(z=z.tag,Z!==null&&Z===h)break;z!==5&&z!==26&&z!==27||re===null||(Z=re,y?(re=Rs(u,v),re!=null&&C.unshift(pl(u,re,Z))):y||(re=Rs(u,v),re!=null&&C.push(pl(u,re,Z)))),u=u.return}C.length!==0&&i.push({event:a,listeners:C})}var HA=/\r\n?/g,$A=/\u0000|\uFFFD/g;function qb(i){return(typeof i=="string"?i:""+i).replace(HA,`
|
|
49
|
+
`).replace($A,"")}function Gb(i,a){return a=qb(a),qb(i)===a}function _u(){}function rt(i,a,u,h,y,v){switch(u){case"children":typeof h=="string"?a==="body"||a==="textarea"&&h===""||ga(i,h):(typeof h=="number"||typeof h=="bigint")&&a!=="body"&&ga(i,""+h);break;case"className":ca(i,"class",h);break;case"tabIndex":ca(i,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":ca(i,u,h);break;case"style":Ym(i,h,v);break;case"data":if(a!=="object"){ca(i,"data",h);break}case"src":case"href":if(h===""&&(a!=="a"||u!=="href")){i.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(u);break}h=Oo(""+h),i.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){i.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(u==="formAction"?(a!=="input"&&rt(i,a,"name",y.name,y,null),rt(i,a,"formEncType",y.formEncType,y,null),rt(i,a,"formMethod",y.formMethod,y,null),rt(i,a,"formTarget",y.formTarget,y,null)):(rt(i,a,"encType",y.encType,y,null),rt(i,a,"method",y.method,y,null),rt(i,a,"target",y.target,y,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(u);break}h=Oo(""+h),i.setAttribute(u,h);break;case"onClick":h!=null&&(i.onclick=_u);break;case"onScroll":h!=null&&He("scroll",i);break;case"onScrollEnd":h!=null&&He("scrollend",i);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(y.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"multiple":i.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":i.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){i.removeAttribute("xlink:href");break}u=Oo(""+h),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(u,""+h):i.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":h===!0?i.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(u,h):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?i.setAttribute(u,h):i.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?i.removeAttribute(u):i.setAttribute(u,h);break;case"popover":He("beforetoggle",i),He("toggle",i),ua(i,"popover",h);break;case"xlinkActuate":zn(i,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":zn(i,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":zn(i,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":zn(i,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":zn(i,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":zn(i,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":zn(i,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":zn(i,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":zn(i,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":ua(i,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=v2.get(u)||u,ua(i,u,h))}}function th(i,a,u,h,y,v){switch(u){case"style":Ym(i,h,v);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(y.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"children":typeof h=="string"?ga(i,h):(typeof h=="number"||typeof h=="bigint")&&ga(i,""+h);break;case"onScroll":h!=null&&He("scroll",i);break;case"onScrollEnd":h!=null&&He("scrollend",i);break;case"onClick":h!=null&&(i.onclick=_u);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!So.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),a=u.slice(2,y?u.length-7:void 0),v=i[Ut]||null,v=v!=null?v[u]:null,typeof v=="function"&&i.removeEventListener(a,v,y),typeof h=="function")){typeof v!="function"&&v!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(a,h,y);break e}u in i?i[u]=h:h===!0?i.setAttribute(u,""):ua(i,u,h)}}}function It(i,a,u){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",i),He("load",i);var h=!1,y=!1,v;for(v in u)if(u.hasOwnProperty(v)){var C=u[v];if(C!=null)switch(v){case"src":h=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:rt(i,a,v,C,u,null)}}y&&rt(i,a,"srcSet",u.srcSet,u,null),h&&rt(i,a,"src",u.src,u,null);return;case"input":He("invalid",i);var z=v=C=y=null,Z=null,re=null;for(h in u)if(u.hasOwnProperty(h)){var oe=u[h];if(oe!=null)switch(h){case"name":y=oe;break;case"type":C=oe;break;case"checked":Z=oe;break;case"defaultChecked":re=oe;break;case"value":v=oe;break;case"defaultValue":z=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,a));break;default:rt(i,a,h,oe,u,null)}}Vm(i,v,z,Z,re,C,y,!1),da(i);return;case"select":He("invalid",i),h=C=v=null;for(y in u)if(u.hasOwnProperty(y)&&(z=u[y],z!=null))switch(y){case"value":v=z;break;case"defaultValue":C=z;break;case"multiple":h=z;default:rt(i,a,y,z,u,null)}a=v,u=C,i.multiple=!!h,a!=null?pa(i,!!h,a,!1):u!=null&&pa(i,!!h,u,!0);return;case"textarea":He("invalid",i),v=y=h=null;for(C in u)if(u.hasOwnProperty(C)&&(z=u[C],z!=null))switch(C){case"value":h=z;break;case"defaultValue":y=z;break;case"children":v=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(r(91));break;default:rt(i,a,C,z,u,null)}Gm(i,h,y,v),da(i);return;case"option":for(Z in u)if(u.hasOwnProperty(Z)&&(h=u[Z],h!=null))switch(Z){case"selected":i.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:rt(i,a,Z,h,u,null)}return;case"dialog":He("beforetoggle",i),He("toggle",i),He("cancel",i),He("close",i);break;case"iframe":case"object":He("load",i);break;case"video":case"audio":for(h=0;h<hl.length;h++)He(hl[h],i);break;case"image":He("error",i),He("load",i);break;case"details":He("toggle",i);break;case"embed":case"source":case"link":He("error",i),He("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(re in u)if(u.hasOwnProperty(re)&&(h=u[re],h!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:rt(i,a,re,h,u,null)}return;default:if(yf(a)){for(oe in u)u.hasOwnProperty(oe)&&(h=u[oe],h!==void 0&&th(i,a,oe,h,u,void 0));return}}for(z in u)u.hasOwnProperty(z)&&(h=u[z],h!=null&&rt(i,a,z,h,u,null))}function VA(i,a,u,h){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,v=null,C=null,z=null,Z=null,re=null,oe=null;for(ae in u){var de=u[ae];if(u.hasOwnProperty(ae)&&de!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":Z=de;default:h.hasOwnProperty(ae)||rt(i,a,ae,null,h,de)}}for(var ie in h){var ae=h[ie];if(de=u[ie],h.hasOwnProperty(ie)&&(ae!=null||de!=null))switch(ie){case"type":v=ae;break;case"name":y=ae;break;case"checked":re=ae;break;case"defaultChecked":oe=ae;break;case"value":C=ae;break;case"defaultValue":z=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,a));break;default:ae!==de&&rt(i,a,ie,ae,h,de)}}ha(i,C,z,Z,re,oe,v,y);return;case"select":ae=C=z=ie=null;for(v in u)if(Z=u[v],u.hasOwnProperty(v)&&Z!=null)switch(v){case"value":break;case"multiple":ae=Z;default:h.hasOwnProperty(v)||rt(i,a,v,null,h,Z)}for(y in h)if(v=h[y],Z=u[y],h.hasOwnProperty(y)&&(v!=null||Z!=null))switch(y){case"value":ie=v;break;case"defaultValue":z=v;break;case"multiple":C=v;default:v!==Z&&rt(i,a,y,v,h,Z)}a=z,u=C,h=ae,ie!=null?pa(i,!!u,ie,!1):!!h!=!!u&&(a!=null?pa(i,!!u,a,!0):pa(i,!!u,u?[]:"",!1));return;case"textarea":ae=ie=null;for(z in u)if(y=u[z],u.hasOwnProperty(z)&&y!=null&&!h.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:rt(i,a,z,null,h,y)}for(C in h)if(y=h[C],v=u[C],h.hasOwnProperty(C)&&(y!=null||v!=null))switch(C){case"value":ie=y;break;case"defaultValue":ae=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==v&&rt(i,a,C,y,h,v)}qm(i,ie,ae);return;case"option":for(var Re in u)if(ie=u[Re],u.hasOwnProperty(Re)&&ie!=null&&!h.hasOwnProperty(Re))switch(Re){case"selected":i.selected=!1;break;default:rt(i,a,Re,null,h,ie)}for(Z in h)if(ie=h[Z],ae=u[Z],h.hasOwnProperty(Z)&&ie!==ae&&(ie!=null||ae!=null))switch(Z){case"selected":i.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:rt(i,a,Z,ie,h,ae)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Oe in u)ie=u[Oe],u.hasOwnProperty(Oe)&&ie!=null&&!h.hasOwnProperty(Oe)&&rt(i,a,Oe,null,h,ie);for(re in h)if(ie=h[re],ae=u[re],h.hasOwnProperty(re)&&ie!==ae&&(ie!=null||ae!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,a));break;default:rt(i,a,re,ie,h,ae)}return;default:if(yf(a)){for(var it in u)ie=u[it],u.hasOwnProperty(it)&&ie!==void 0&&!h.hasOwnProperty(it)&&th(i,a,it,void 0,h,ie);for(oe in h)ie=h[oe],ae=u[oe],!h.hasOwnProperty(oe)||ie===ae||ie===void 0&&ae===void 0||th(i,a,oe,ie,h,ae);return}}for(var ee in u)ie=u[ee],u.hasOwnProperty(ee)&&ie!=null&&!h.hasOwnProperty(ee)&&rt(i,a,ee,null,h,ie);for(de in h)ie=h[de],ae=u[de],!h.hasOwnProperty(de)||ie===ae||ie==null&&ae==null||rt(i,a,de,ie,h,ae)}var nh=null,rh=null;function Su(i){return i.nodeType===9?i:i.ownerDocument}function Zb(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Yb(i,a){if(i===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&a==="foreignObject"?0:i}function ih(i,a){return i==="textarea"||i==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var ah=null;function qA(){var i=window.event;return i&&i.type==="popstate"?i===ah?!1:(ah=i,!0):(ah=null,!1)}var Xb=typeof setTimeout=="function"?setTimeout:void 0,GA=typeof clearTimeout=="function"?clearTimeout:void 0,Qb=typeof Promise=="function"?Promise:void 0,ZA=typeof queueMicrotask=="function"?queueMicrotask:typeof Qb<"u"?function(i){return Qb.resolve(null).then(i).catch(YA)}:Xb;function YA(i){setTimeout(function(){throw i})}function si(i){return i==="head"}function Kb(i,a){var u=a,h=0,y=0;do{var v=u.nextSibling;if(i.removeChild(u),v&&v.nodeType===8)if(u=v.data,u==="/$"){if(0<h&&8>h){u=h;var C=i.ownerDocument;if(u&1&&gl(C.documentElement),u&2&&gl(C.body),u&4)for(u=C.head,gl(u),C=u.firstChild;C;){var z=C.nextSibling,Z=C.nodeName;C[Ci]||Z==="SCRIPT"||Z==="STYLE"||Z==="LINK"&&C.rel.toLowerCase()==="stylesheet"||u.removeChild(C),C=z}}if(y===0){i.removeChild(v),Sl(a);return}y--}else u==="$"||u==="$?"||u==="$!"?y++:h=u.charCodeAt(0)-48;else h=0;u=v}while(u);Sl(a)}function sh(i){var a=i.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var u=a;switch(a=a.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":sh(u),Ts(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function XA(i,a,u,h){for(;i.nodeType===1;){var y=u;if(i.nodeName.toLowerCase()!==a.toLowerCase()){if(!h&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(h){if(!i[Ci])switch(a){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(v=i.getAttribute("rel"),v==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(v!==y.rel||i.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||i.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||i.getAttribute("title")!==(y.title==null?null:y.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(v=i.getAttribute("src"),(v!==(y.src==null?null:y.src)||i.getAttribute("type")!==(y.type==null?null:y.type)||i.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&v&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(a==="input"&&i.type==="hidden"){var v=y.name==null?null:""+y.name;if(y.type==="hidden"&&i.getAttribute("name")===v)return i}else return i;if(i=Bn(i.nextSibling),i===null)break}return null}function QA(i,a,u){if(a==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=Bn(i.nextSibling),i===null))return null;return i}function lh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState==="complete"}function KA(i,a){var u=i.ownerDocument;if(i.data!=="$?"||u.readyState==="complete")a();else{var h=function(){a(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),i._reactRetry=h}}function Bn(i){for(;i!=null;i=i.nextSibling){var a=i.nodeType;if(a===1||a===3)break;if(a===8){if(a=i.data,a==="$"||a==="$!"||a==="$?"||a==="F!"||a==="F")break;if(a==="/$")return null}}return i}var oh=null;function Jb(i){i=i.previousSibling;for(var a=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"){if(a===0)return i;a--}else u==="/$"&&a++}i=i.previousSibling}return null}function Wb(i,a,u){switch(a=Su(u),i){case"html":if(i=a.documentElement,!i)throw Error(r(452));return i;case"head":if(i=a.head,!i)throw Error(r(453));return i;case"body":if(i=a.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function gl(i){for(var a=i.attributes;a.length;)i.removeAttributeNode(a[0]);Ts(i)}var On=new Map,ev=new Set;function ku(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Cr=P.d;P.d={f:JA,r:WA,D:eT,C:tT,L:nT,m:rT,X:aT,S:iT,M:sT};function JA(){var i=Cr.f(),a=gu();return i||a}function WA(i){var a=pr(i);a!==null&&a.tag===5&&a.type==="form"?x0(a):Cr.r(i)}var Va=typeof document>"u"?null:document;function tv(i,a,u){var h=Va;if(h&&typeof a=="string"&&a){var y=Wt(a);y='link[rel="'+i+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),ev.has(y)||(ev.add(y),i={rel:i,crossOrigin:u,href:a},h.querySelector(y)===null&&(a=h.createElement("link"),It(a,"link",i),_t(a),h.head.appendChild(a)))}}function eT(i){Cr.D(i),tv("dns-prefetch",i,null)}function tT(i,a){Cr.C(i,a),tv("preconnect",i,a)}function nT(i,a,u){Cr.L(i,a,u);var h=Va;if(h&&i&&a){var y='link[rel="preload"][as="'+Wt(a)+'"]';a==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+Wt(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+Wt(u.imageSizes)+'"]')):y+='[href="'+Wt(i)+'"]';var v=y;switch(a){case"style":v=qa(i);break;case"script":v=Ga(i)}On.has(v)||(i=p({rel:"preload",href:a==="image"&&u&&u.imageSrcSet?void 0:i,as:a},u),On.set(v,i),h.querySelector(y)!==null||a==="style"&&h.querySelector(ml(v))||a==="script"&&h.querySelector(yl(v))||(a=h.createElement("link"),It(a,"link",i),_t(a),h.head.appendChild(a)))}}function rT(i,a){Cr.m(i,a);var u=Va;if(u&&i){var h=a&&typeof a.as=="string"?a.as:"script",y='link[rel="modulepreload"][as="'+Wt(h)+'"][href="'+Wt(i)+'"]',v=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Ga(i)}if(!On.has(v)&&(i=p({rel:"modulepreload",href:i},a),On.set(v,i),u.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(yl(v)))return}h=u.createElement("link"),It(h,"link",i),_t(h),u.head.appendChild(h)}}}function iT(i,a,u){Cr.S(i,a,u);var h=Va;if(h&&i){var y=Pr(h).hoistableStyles,v=qa(i);a=a||"default";var C=y.get(v);if(!C){var z={loading:0,preload:null};if(C=h.querySelector(ml(v)))z.loading=5;else{i=p({rel:"stylesheet",href:i,"data-precedence":a},u),(u=On.get(v))&&uh(i,u);var Z=C=h.createElement("link");_t(Z),It(Z,"link",i),Z._p=new Promise(function(re,oe){Z.onload=re,Z.onerror=oe}),Z.addEventListener("load",function(){z.loading|=1}),Z.addEventListener("error",function(){z.loading|=2}),z.loading|=4,Eu(C,a,h)}C={type:"stylesheet",instance:C,count:1,state:z},y.set(v,C)}}}function aT(i,a){Cr.X(i,a);var u=Va;if(u&&i){var h=Pr(u).hoistableScripts,y=Ga(i),v=h.get(y);v||(v=u.querySelector(yl(y)),v||(i=p({src:i,async:!0},a),(a=On.get(y))&&ch(i,a),v=u.createElement("script"),_t(v),It(v,"link",i),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},h.set(y,v))}}function sT(i,a){Cr.M(i,a);var u=Va;if(u&&i){var h=Pr(u).hoistableScripts,y=Ga(i),v=h.get(y);v||(v=u.querySelector(yl(y)),v||(i=p({src:i,async:!0,type:"module"},a),(a=On.get(y))&&ch(i,a),v=u.createElement("script"),_t(v),It(v,"link",i),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},h.set(y,v))}}function nv(i,a,u,h){var y=(y=J.current)?ku(y):null;if(!y)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(a=qa(u.href),u=Pr(y).hoistableStyles,h=u.get(a),h||(h={type:"style",instance:null,count:0,state:null},u.set(a,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=qa(u.href);var v=Pr(y).hoistableStyles,C=v.get(i);if(C||(y=y.ownerDocument||y,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(i,C),(v=y.querySelector(ml(i)))&&!v._p&&(C.instance=v,C.state.loading=5),On.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},On.set(i,u),v||lT(y,i,u,C.state))),a&&h===null)throw Error(r(528,""));return C}if(a&&h!==null)throw Error(r(529,""));return null;case"script":return a=u.async,u=u.src,typeof u=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Ga(u),u=Pr(y).hoistableScripts,h=u.get(a),h||(h={type:"script",instance:null,count:0,state:null},u.set(a,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function qa(i){return'href="'+Wt(i)+'"'}function ml(i){return'link[rel="stylesheet"]['+i+"]"}function rv(i){return p({},i,{"data-precedence":i.precedence,precedence:null})}function lT(i,a,u,h){i.querySelector('link[rel="preload"][as="style"]['+a+"]")?h.loading=1:(a=i.createElement("link"),h.preload=a,a.addEventListener("load",function(){return h.loading|=1}),a.addEventListener("error",function(){return h.loading|=2}),It(a,"link",u),_t(a),i.head.appendChild(a))}function Ga(i){return'[src="'+Wt(i)+'"]'}function yl(i){return"script[async]"+i}function iv(i,a,u){if(a.count++,a.instance===null)switch(a.type){case"style":var h=i.querySelector('style[data-href~="'+Wt(u.href)+'"]');if(h)return a.instance=h,_t(h),h;var y=p({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(i.ownerDocument||i).createElement("style"),_t(h),It(h,"style",y),Eu(h,u.precedence,i),a.instance=h;case"stylesheet":y=qa(u.href);var v=i.querySelector(ml(y));if(v)return a.state.loading|=4,a.instance=v,_t(v),v;h=rv(u),(y=On.get(y))&&uh(h,y),v=(i.ownerDocument||i).createElement("link"),_t(v);var C=v;return C._p=new Promise(function(z,Z){C.onload=z,C.onerror=Z}),It(v,"link",h),a.state.loading|=4,Eu(v,u.precedence,i),a.instance=v;case"script":return v=Ga(u.src),(y=i.querySelector(yl(v)))?(a.instance=y,_t(y),y):(h=u,(y=On.get(v))&&(h=p({},u),ch(h,y)),i=i.ownerDocument||i,y=i.createElement("script"),_t(y),It(y,"link",h),i.head.appendChild(y),a.instance=y);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(h=a.instance,a.state.loading|=4,Eu(h,u.precedence,i));return a.instance}function Eu(i,a,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,v=y,C=0;C<h.length;C++){var z=h[C];if(z.dataset.precedence===a)v=z;else if(v!==y)break}v?v.parentNode.insertBefore(i,v.nextSibling):(a=u.nodeType===9?u.head:u,a.insertBefore(i,a.firstChild))}function uh(i,a){i.crossOrigin==null&&(i.crossOrigin=a.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=a.referrerPolicy),i.title==null&&(i.title=a.title)}function ch(i,a){i.crossOrigin==null&&(i.crossOrigin=a.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=a.referrerPolicy),i.integrity==null&&(i.integrity=a.integrity)}var Au=null;function av(i,a,u){if(Au===null){var h=new Map,y=Au=new Map;y.set(u,h)}else y=Au,h=y.get(u),h||(h=new Map,y.set(u,h));if(h.has(i))return h;for(h.set(i,null),u=u.getElementsByTagName(i),y=0;y<u.length;y++){var v=u[y];if(!(v[Ci]||v[Mt]||i==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var C=v.getAttribute(a)||"";C=i+C;var z=h.get(C);z?z.push(v):h.set(C,[v])}}return h}function sv(i,a,u){i=i.ownerDocument||i,i.head.insertBefore(u,a==="title"?i.querySelector("head > title"):null)}function oT(i,a,u){if(u===1||a.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return i=a.disabled,typeof a.precedence=="string"&&i==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function lv(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}var bl=null;function uT(){}function cT(i,a,u){if(bl===null)throw Error(r(475));var h=bl;if(a.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var y=qa(u.href),v=i.querySelector(ml(y));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(h.count++,h=Tu.bind(h),i.then(h,h)),a.state.loading|=4,a.instance=v,_t(v);return}v=i.ownerDocument||i,u=rv(u),(y=On.get(y))&&uh(u,y),v=v.createElement("link"),_t(v);var C=v;C._p=new Promise(function(z,Z){C.onload=z,C.onerror=Z}),It(v,"link",u),a.instance=v}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(a,i),(i=a.state.preload)&&(a.state.loading&3)===0&&(h.count++,a=Tu.bind(h),i.addEventListener("load",a),i.addEventListener("error",a))}}function fT(){if(bl===null)throw Error(r(475));var i=bl;return i.stylesheets&&i.count===0&&fh(i,i.stylesheets),0<i.count?function(a){var u=setTimeout(function(){if(i.stylesheets&&fh(i,i.stylesheets),i.unsuspend){var h=i.unsuspend;i.unsuspend=null,h()}},6e4);return i.unsuspend=a,function(){i.unsuspend=null,clearTimeout(u)}}:null}function Tu(){if(this.count--,this.count===0){if(this.stylesheets)fh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Nu=null;function fh(i,a){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Nu=new Map,a.forEach(dT,i),Nu=null,Tu.call(i))}function dT(i,a){if(!(a.state.loading&4)){var u=Nu.get(i);if(u)var h=u.get(null);else{u=new Map,Nu.set(i,u);for(var y=i.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<y.length;v++){var C=y[v];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(u.set(C.dataset.precedence,C),h=C)}h&&u.set(null,h)}y=a.instance,C=y.getAttribute("data-precedence"),v=u.get(C)||h,v===h&&u.set(null,y),u.set(C,y),this.count++,h=Tu.bind(this),y.addEventListener("load",h),y.addEventListener("error",h),v?v.parentNode.insertBefore(y,v.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(y,i.firstChild)),a.state.loading|=4}}var vl={$$typeof:S,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function hT(i,a,u,h,y,v,C,z){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=_s(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_s(0),this.hiddenUpdates=_s(null),this.identifierPrefix=h,this.onUncaughtError=y,this.onCaughtError=v,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function ov(i,a,u,h,y,v,C,z,Z,re,oe,de){return i=new hT(i,a,u,C,z,Z,re,de),a=1,v===!0&&(a|=24),v=fn(3,null,null,a),i.current=v,v.stateNode=i,a=Gf(),a.refCount++,i.pooledCache=a,a.refCount++,v.memoizedState={element:h,isDehydrated:u,cache:a},Qf(v),i}function uv(i){return i?(i=Sa,i):Sa}function cv(i,a,u,h,y,v){y=uv(y),h.context===null?h.context=y:h.pendingContext=y,h=Zr(a),h.payload={element:u},v=v===void 0?null:v,v!==null&&(h.callback=v),u=Yr(i,h,a),u!==null&&(mn(u,i,a),Xs(u,i,a))}function fv(i,a){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<a?u:a}}function dh(i,a){fv(i,a),(i=i.alternate)&&fv(i,a)}function dv(i){if(i.tag===13){var a=_a(i,67108864);a!==null&&mn(a,i,67108864),dh(i,67108864)}}var Cu=!0;function pT(i,a,u,h){var y=I.T;I.T=null;var v=P.p;try{P.p=2,hh(i,a,u,h)}finally{P.p=v,I.T=y}}function gT(i,a,u,h){var y=I.T;I.T=null;var v=P.p;try{P.p=8,hh(i,a,u,h)}finally{P.p=v,I.T=y}}function hh(i,a,u,h){if(Cu){var y=ph(h);if(y===null)eh(i,a,h,Ou,u),pv(i,h);else if(yT(y,i,a,u,h))h.stopPropagation();else if(pv(i,h),a&4&&-1<mT.indexOf(i)){for(;y!==null;){var v=pr(y);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var C=Zt(v.pendingLanes);if(C!==0){var z=v;for(z.pendingLanes|=2,z.entangledLanes|=2;C;){var Z=1<<31-Te(C);z.entanglements[1]|=Z,C&=~Z}rr(v),(We&6)===0&&(hu=xt()+500,dl(0))}}break;case 13:z=_a(v,2),z!==null&&mn(z,v,2),gu(),dh(v,2)}if(v=ph(h),v===null&&eh(i,a,h,Ou,u),v===y)break;y=v}y!==null&&h.stopPropagation()}else eh(i,a,h,null,u)}}function ph(i){return i=vf(i),gh(i)}var Ou=null;function gh(i){if(Ou=null,i=hr(i),i!==null){var a=l(i);if(a===null)i=null;else{var u=a.tag;if(u===13){if(i=o(a),i!==null)return i;i=null}else if(u===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;i=null}else a!==i&&(i=null)}}return Ou=i,null}function hv(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ai()){case fr:return 2;case Dn:return 8;case Xn:case dr:return 32;case Qn:return 268435456;default:return 32}default:return 32}}var mh=!1,li=null,oi=null,ui=null,xl=new Map,wl=new Map,ci=[],mT="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function pv(i,a){switch(i){case"focusin":case"focusout":li=null;break;case"dragenter":case"dragleave":oi=null;break;case"mouseover":case"mouseout":ui=null;break;case"pointerover":case"pointerout":xl.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":wl.delete(a.pointerId)}}function _l(i,a,u,h,y,v){return i===null||i.nativeEvent!==v?(i={blockedOn:a,domEventName:u,eventSystemFlags:h,nativeEvent:v,targetContainers:[y]},a!==null&&(a=pr(a),a!==null&&dv(a)),i):(i.eventSystemFlags|=h,a=i.targetContainers,y!==null&&a.indexOf(y)===-1&&a.push(y),i)}function yT(i,a,u,h,y){switch(a){case"focusin":return li=_l(li,i,a,u,h,y),!0;case"dragenter":return oi=_l(oi,i,a,u,h,y),!0;case"mouseover":return ui=_l(ui,i,a,u,h,y),!0;case"pointerover":var v=y.pointerId;return xl.set(v,_l(xl.get(v)||null,i,a,u,h,y)),!0;case"gotpointercapture":return v=y.pointerId,wl.set(v,_l(wl.get(v)||null,i,a,u,h,y)),!0}return!1}function gv(i){var a=hr(i.target);if(a!==null){var u=l(a);if(u!==null){if(a=u.tag,a===13){if(a=o(u),a!==null){i.blockedOn=a,cf(i.priority,function(){if(u.tag===13){var h=gn();h=ks(h);var y=_a(u,h);y!==null&&mn(y,u,h),dh(u,h)}});return}}else if(a===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Mu(i){if(i.blockedOn!==null)return!1;for(var a=i.targetContainers;0<a.length;){var u=ph(i.nativeEvent);if(u===null){u=i.nativeEvent;var h=new u.constructor(u.type,u);bf=h,u.target.dispatchEvent(h),bf=null}else return a=pr(u),a!==null&&dv(a),i.blockedOn=u,!1;a.shift()}return!0}function mv(i,a,u){Mu(i)&&u.delete(a)}function bT(){mh=!1,li!==null&&Mu(li)&&(li=null),oi!==null&&Mu(oi)&&(oi=null),ui!==null&&Mu(ui)&&(ui=null),xl.forEach(mv),wl.forEach(mv)}function Ru(i,a){i.blockedOn===a&&(i.blockedOn=null,mh||(mh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,bT)))}var Du=null;function yv(i){Du!==i&&(Du=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Du===i&&(Du=null);for(var a=0;a<i.length;a+=3){var u=i[a],h=i[a+1],y=i[a+2];if(typeof h!="function"){if(gh(h||u)===null)continue;break}var v=pr(u);v!==null&&(i.splice(a,3),a-=3,gd(v,{pending:!0,data:y,method:u.method,action:h},h,y))}}))}function Sl(i){function a(Z){return Ru(Z,i)}li!==null&&Ru(li,i),oi!==null&&Ru(oi,i),ui!==null&&Ru(ui,i),xl.forEach(a),wl.forEach(a);for(var u=0;u<ci.length;u++){var h=ci[u];h.blockedOn===i&&(h.blockedOn=null)}for(;0<ci.length&&(u=ci[0],u.blockedOn===null);)gv(u),u.blockedOn===null&&ci.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var y=u[h],v=u[h+1],C=y[Ut]||null;if(typeof v=="function")C||yv(u);else if(C){var z=null;if(v&&v.hasAttribute("formAction")){if(y=v,C=v[Ut]||null)z=C.formAction;else if(gh(y)!==null)continue}else z=C.action;typeof z=="function"?u[h+1]=z:(u.splice(h,3),h-=3),yv(u)}}}function yh(i){this._internalRoot=i}ju.prototype.render=yh.prototype.render=function(i){var a=this._internalRoot;if(a===null)throw Error(r(409));var u=a.current,h=gn();cv(u,h,i,a,null,null)},ju.prototype.unmount=yh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var a=i.containerInfo;cv(i.current,2,null,i,null,null),gu(),a[Br]=null}};function ju(i){this._internalRoot=i}ju.prototype.unstable_scheduleHydration=function(i){if(i){var a=xo();i={blockedOn:null,target:i,priority:a};for(var u=0;u<ci.length&&a!==0&&a<ci[u].priority;u++);ci.splice(u,0,i),u===0&&gv(i)}};var bv=t.version;if(bv!=="19.1.0")throw Error(r(527,bv,"19.1.0"));P.findDOMNode=function(i){var a=i._reactInternals;if(a===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=f(a),i=i!==null?d(i):null,i=i===null?null:i.stateNode,i};var vT={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zu.isDisabled&&zu.supportsFiber)try{se=zu.inject(vT),he=zu}catch{}}return El.createRoot=function(i,a){if(!s(i))throw Error(r(299));var u=!1,h="",y=j0,v=z0,C=L0,z=null;return a!=null&&(a.unstable_strictMode===!0&&(u=!0),a.identifierPrefix!==void 0&&(h=a.identifierPrefix),a.onUncaughtError!==void 0&&(y=a.onUncaughtError),a.onCaughtError!==void 0&&(v=a.onCaughtError),a.onRecoverableError!==void 0&&(C=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(z=a.unstable_transitionCallbacks)),a=ov(i,1,!1,null,null,u,h,y,v,C,z,null),i[Br]=a.current,Wd(i),new yh(a)},El.hydrateRoot=function(i,a,u){if(!s(i))throw Error(r(299));var h=!1,y="",v=j0,C=z0,z=L0,Z=null,re=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(v=u.onUncaughtError),u.onCaughtError!==void 0&&(C=u.onCaughtError),u.onRecoverableError!==void 0&&(z=u.onRecoverableError),u.unstable_transitionCallbacks!==void 0&&(Z=u.unstable_transitionCallbacks),u.formState!==void 0&&(re=u.formState)),a=ov(i,1,!0,a,u??null,h,y,v,C,z,Z,re),a.context=uv(null),u=a.current,h=gn(),h=ks(h),y=Zr(h),y.callback=null,Yr(u,y,h),u=h,a.current.lanes=u,Ni(a,u),rr(a),i[Br]=a.current,Wd(i),new ju(a)},El.version="19.1.0",El}var Nv;function OT(){if(Nv)return vh.exports;Nv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),vh.exports=CT(),vh.exports}var MT=OT();const RT=ki(MT);var W=so();const DT=ki(W),jT=({content:e})=>{const t=()=>typeof e=="string"?N.jsx("div",{className:"text-white whitespace-pre-wrap",children:e}):Array.isArray(e)?e.map((n,r)=>{switch(n.type){case"text":return N.jsx("div",{className:"text-white",children:n.text},r);case"image_url":return N.jsx("div",{className:"mt-2",children:N.jsx("img",{src:n.image_url.url,alt:"用户上传的图片",className:"max-w-[200px] rounded"})},r);case"audio":return N.jsx("div",{className:"mt-2",children:N.jsx("audio",{controls:!0,src:n.audio_url,className:"w-full",children:"您的浏览器不支持音频播放"})},r);default:return N.jsx("div",{className:"text-white whitespace-pre-wrap",children:JSON.stringify(n)},r)}}):N.jsx("div",{className:"text-white whitespace-pre-wrap",children:JSON.stringify(e)});return N.jsx("div",{className:"flex flex-row w-full justify-end",children:N.jsx("div",{className:"flex flex-col w-fit bg-blue-500 rounded-lg text-white border border-blue-100",children:N.jsx("div",{className:"flex flex-col p-4 ",children:t()})})})},kh=e=>e.toString(),rm=({usage_metadata:e,spend_time:t,response_metadata:n,id:r,tool_call_id:s})=>{const l=t?(e.output_tokens||0)*1e3/(t||1):0;return N.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500 mt-2",children:[N.jsxs("div",{className:"flex items-center gap-3",children:[N.jsx(zT,{usage_metadata:e}),t&&N.jsxs("span",{className:"text-gray-500",children:[(t/1e3).toFixed(2),"s"]}),l&&N.jsxs("span",{className:"text-gray-500",children:[l.toFixed(2)," TPS"]})]}),N.jsxs("div",{className:"flex items-center gap-2",children:[(n==null?void 0:n.model_name)&&N.jsx("span",{className:"text-gray-600",children:n.model_name}),s&&N.jsxs("span",{className:"text-gray-500",children:["Tool: ",s]}),r&&N.jsxs("span",{className:"text-gray-500",children:["ID: ",r]})]})]})},zT=({usage_metadata:e})=>N.jsx("div",{className:"flex items-center gap-1",children:N.jsxs("span",{className:"flex items-center gap-1 group relative",children:[N.jsx("span",{children:"📊"}),kh(e.total_tokens||0),N.jsx("div",{className:"hidden group-hover:block absolute bottom-full ml-2 bg-gray-100 p-2 rounded text-xs shadow border",children:N.jsx("div",{className:"flex flex-col gap-1",children:N.jsxs("div",{className:"flex flex-col gap-1",children:[N.jsxs("span",{className:"flex items-center gap-1",children:[N.jsx("span",{children:"📥"}),kh(e.input_tokens||0),N.jsxs("div",{children:[" ",JSON.stringify(e.prompt_tokens_details)]})]}),N.jsxs("span",{className:"flex items-center gap-1",children:[N.jsx("span",{children:"📤"}),kh(e.output_tokens||0),N.jsxs("div",{children:[" ",JSON.stringify(e.completion_tokens_details)]})]})]})})})]})});var Al={exports:{}},Eh={},Ah,Cv;function LT(){if(Cv)return Ah;Cv=1;function e(t,n){typeof n=="boolean"&&(n={forever:n}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=n||{},this._maxRetryTime=n&&n.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}return Ah=e,e.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},e.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},e.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var n=new Date().getTime();if(t&&n-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1);else return!1;var s=this;return this._timer=setTimeout(function(){s._attempts++,s._operationTimeoutCb&&(s._timeout=setTimeout(function(){s._operationTimeoutCb(s._attempts)},s._operationTimeout),s._options.unref&&s._timeout.unref()),s._fn(s._attempts)},r),this._options.unref&&this._timer.unref(),!0},e.prototype.attempt=function(t,n){this._fn=t,n&&(n.timeout&&(this._operationTimeout=n.timeout),n.cb&&(this._operationTimeoutCb=n.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},e.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)},e.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)},e.prototype.start=e.prototype.try,e.prototype.errors=function(){return this._errors},e.prototype.attempts=function(){return this._attempts},e.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},n=null,r=0,s=0;s<this._errors.length;s++){var l=this._errors[s],o=l.message,c=(t[o]||0)+1;t[o]=c,c>=r&&(n=l,r=c)}return n},Ah}var Ov;function IT(){return Ov||(Ov=1,function(e){var t=LT();e.operation=function(n){var r=e.timeouts(n);return new t(r,{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(n){if(n instanceof Array)return[].concat(n);var r={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var s in n)r[s]=n[s];if(r.minTimeout>r.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var l=[],o=0;o<r.retries;o++)l.push(this.createTimeout(o,r));return n&&n.forever&&!l.length&&l.push(this.createTimeout(o,r)),l.sort(function(c,f){return c-f}),l},e.createTimeout=function(n,r){var s=r.randomize?Math.random()+1:1,l=Math.round(s*Math.max(r.minTimeout,1)*Math.pow(r.factor,n));return l=Math.min(l,r.maxTimeout),l},e.wrap=function(n,r,s){if(r instanceof Array&&(s=r,r=null),!s){s=[];for(var l in n)typeof n[l]=="function"&&s.push(l)}for(var o=0;o<s.length;o++){var c=s[o],f=n[c];n[c]=(function(p){var g=e.operation(r),m=Array.prototype.slice.call(arguments,1),b=m.pop();m.push(function(x){g.retry(x)||(x&&(arguments[0]=g.mainError()),b.apply(this,arguments))}),g.attempt(function(){p.apply(n,m)})}).bind(n,f),n[c].options=r}}}(Eh)),Eh}var Th,Mv;function BT(){return Mv||(Mv=1,Th=IT()),Th}var Rv;function FT(){if(Rv)return Al.exports;Rv=1;const e=BT(),t=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class n extends Error{constructor(c){super(),c instanceof Error?(this.originalError=c,{message:c}=c):(this.originalError=new Error(c),this.originalError.stack=this.stack),this.name="AbortError",this.message=c}}const r=(o,c,f)=>{const d=f.retries-(c-1);return o.attemptNumber=c,o.retriesLeft=d,o},s=o=>t.includes(o),l=(o,c)=>new Promise((f,d)=>{c={onFailedAttempt:()=>{},retries:10,...c};const p=e.operation(c);p.attempt(async g=>{try{f(await o(g))}catch(m){if(!(m instanceof Error)){d(new TypeError(`Non-error was thrown: "${m}". You should only throw errors.`));return}if(m instanceof n)p.stop(),d(m.originalError);else if(m instanceof TypeError&&!s(m.message))p.stop(),d(m);else{r(m,g,c);try{await c.onFailedAttempt(m)}catch(b){d(b);return}p.retry(m)||d(p.mainError())}}})});return Al.exports=l,Al.exports.default=l,Al.exports.AbortError=n,Al.exports}var PT=FT();const UT=ki(PT);var Lu={},Nh={exports:{}},Dv;function HT(){return Dv||(Dv=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function s(f,d,p){this.fn=f,this.context=d,this.once=p||!1}function l(f,d,p,g,m){if(typeof p!="function")throw new TypeError("The listener must be a function");var b=new s(p,g||f,m),x=n?n+d:d;return f._events[x]?f._events[x].fn?f._events[x]=[f._events[x],b]:f._events[x].push(b):(f._events[x]=b,f._eventsCount++),f}function o(f,d){--f._eventsCount===0?f._events=new r:delete f._events[d]}function c(){this._events=new r,this._eventsCount=0}c.prototype.eventNames=function(){var d=[],p,g;if(this._eventsCount===0)return d;for(g in p=this._events)t.call(p,g)&&d.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(p)):d},c.prototype.listeners=function(d){var p=n?n+d:d,g=this._events[p];if(!g)return[];if(g.fn)return[g.fn];for(var m=0,b=g.length,x=new Array(b);m<b;m++)x[m]=g[m].fn;return x},c.prototype.listenerCount=function(d){var p=n?n+d:d,g=this._events[p];return g?g.fn?1:g.length:0},c.prototype.emit=function(d,p,g,m,b,x){var w=n?n+d:d;if(!this._events[w])return!1;var _=this._events[w],k=arguments.length,A,S;if(_.fn){switch(_.once&&this.removeListener(d,_.fn,void 0,!0),k){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,p),!0;case 3:return _.fn.call(_.context,p,g),!0;case 4:return _.fn.call(_.context,p,g,m),!0;case 5:return _.fn.call(_.context,p,g,m,b),!0;case 6:return _.fn.call(_.context,p,g,m,b,x),!0}for(S=1,A=new Array(k-1);S<k;S++)A[S-1]=arguments[S];_.fn.apply(_.context,A)}else{var O=_.length,D;for(S=0;S<O;S++)switch(_[S].once&&this.removeListener(d,_[S].fn,void 0,!0),k){case 1:_[S].fn.call(_[S].context);break;case 2:_[S].fn.call(_[S].context,p);break;case 3:_[S].fn.call(_[S].context,p,g);break;case 4:_[S].fn.call(_[S].context,p,g,m);break;default:if(!A)for(D=1,A=new Array(k-1);D<k;D++)A[D-1]=arguments[D];_[S].fn.apply(_[S].context,A)}}return!0},c.prototype.on=function(d,p,g){return l(this,d,p,g,!1)},c.prototype.once=function(d,p,g){return l(this,d,p,g,!0)},c.prototype.removeListener=function(d,p,g,m){var b=n?n+d:d;if(!this._events[b])return this;if(!p)return o(this,b),this;var x=this._events[b];if(x.fn)x.fn===p&&(!m||x.once)&&(!g||x.context===g)&&o(this,b);else{for(var w=0,_=[],k=x.length;w<k;w++)(x[w].fn!==p||m&&!x[w].once||g&&x[w].context!==g)&&_.push(x[w]);_.length?this._events[b]=_.length===1?_[0]:_:o(this,b)}return this},c.prototype.removeAllListeners=function(d){var p;return d?(p=n?n+d:d,this._events[p]&&o(this,p)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c}(Nh)),Nh.exports}var Tl={exports:{}},Ch,jv;function $T(){return jv||(jv=1,Ch=(e,t)=>(t=t||(()=>{}),e.then(n=>new Promise(r=>{r(t())}).then(()=>n),n=>new Promise(r=>{r(t())}).then(()=>{throw n})))),Ch}var zv;function VT(){if(zv)return Tl.exports;zv=1;const e=$T();class t extends Error{constructor(s){super(s),this.name="TimeoutError"}}const n=(r,s,l)=>new Promise((o,c)=>{if(typeof s!="number"||s<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(s===1/0){o(r);return}const f=setTimeout(()=>{if(typeof l=="function"){try{o(l())}catch(g){c(g)}return}const d=typeof l=="string"?l:`Promise timed out after ${s} milliseconds`,p=l instanceof Error?l:new t(d);typeof r.cancel=="function"&&r.cancel(),c(p)},s);e(r.then(o,c),()=>{clearTimeout(f)})});return Tl.exports=n,Tl.exports.default=n,Tl.exports.TimeoutError=t,Tl.exports}var Iu={},Bu={},Lv;function qT(){if(Lv)return Bu;Lv=1,Object.defineProperty(Bu,"__esModule",{value:!0});function e(t,n,r){let s=0,l=t.length;for(;l>0;){const o=l/2|0;let c=s+o;r(t[c],n)<=0?(s=++c,l-=o+1):l=o}return s}return Bu.default=e,Bu}var Iv;function GT(){if(Iv)return Iu;Iv=1,Object.defineProperty(Iu,"__esModule",{value:!0});const e=qT();class t{constructor(){this._queue=[]}enqueue(r,s){s=Object.assign({priority:0},s);const l={priority:s.priority,run:r};if(this.size&&this._queue[this.size-1].priority>=s.priority){this._queue.push(l);return}const o=e.default(this._queue,l,(c,f)=>f.priority-c.priority);this._queue.splice(o,0,l)}dequeue(){const r=this._queue.shift();return r==null?void 0:r.run}filter(r){return this._queue.filter(s=>s.priority===r.priority).map(s=>s.run)}get size(){return this._queue.length}}return Iu.default=t,Iu}var Bv;function ZT(){if(Bv)return Lu;Bv=1,Object.defineProperty(Lu,"__esModule",{value:!0});const e=HT(),t=VT(),n=GT(),r=()=>{},s=new t.TimeoutError;class l extends e{constructor(c){var f,d,p,g;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=r,this._resolveIdle=r,c=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:n.default},c),!(typeof c.intervalCap=="number"&&c.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(d=(f=c.intervalCap)===null||f===void 0?void 0:f.toString())!==null&&d!==void 0?d:""}\` (${typeof c.intervalCap})`);if(c.interval===void 0||!(Number.isFinite(c.interval)&&c.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(g=(p=c.interval)===null||p===void 0?void 0:p.toString())!==null&&g!==void 0?g:""}\` (${typeof c.interval})`);this._carryoverConcurrencyCount=c.carryoverConcurrencyCount,this._isIntervalIgnored=c.intervalCap===1/0||c.interval===0,this._intervalCap=c.intervalCap,this._interval=c.interval,this._queue=new c.queueClass,this._queueClass=c.queueClass,this.concurrency=c.concurrency,this._timeout=c.timeout,this._throwOnTimeout=c.throwOnTimeout===!0,this._isPaused=c.autoStart===!1}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=r,this._pendingCount===0&&(this._resolveIdle(),this._resolveIdle=r,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){const c=Date.now();if(this._intervalId===void 0){const f=this._intervalEnd-c;if(f<0)this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0;else return this._timeoutId===void 0&&(this._timeoutId=setTimeout(()=>{this._onResumeInterval()},f)),!0}return!1}_tryToStartAnother(){if(this._queue.size===0)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const c=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const f=this._queue.dequeue();return f?(this.emit("active"),f(),c&&this._initializeIntervalIfNeeded(),!0):!1}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||this._intervalId!==void 0||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){this._intervalCount===0&&this._pendingCount===0&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(c){if(!(typeof c=="number"&&c>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${c}\` (${typeof c})`);this._concurrency=c,this._processQueue()}async add(c,f={}){return new Promise((d,p)=>{const g=async()=>{this._pendingCount++,this._intervalCount++;try{const m=this._timeout===void 0&&f.timeout===void 0?c():t.default(Promise.resolve(c()),f.timeout===void 0?this._timeout:f.timeout,()=>{(f.throwOnTimeout===void 0?this._throwOnTimeout:f.throwOnTimeout)&&p(s)});d(await m)}catch(m){p(m)}this._next()};this._queue.enqueue(g,f),this._tryToStartAnother(),this.emit("add")})}async addAll(c,f){return Promise.all(c.map(async d=>this.add(d,f)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size!==0)return new Promise(c=>{const f=this._resolveEmpty;this._resolveEmpty=()=>{f(),c()}})}async onIdle(){if(!(this._pendingCount===0&&this._queue.size===0))return new Promise(c=>{const f=this._resolveIdle;this._resolveIdle=()=>{f(),c()}})}get size(){return this._queue.size}sizeBy(c){return this._queue.filter(c).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(c){this._timeout=c}}return Lu.default=l,Lu}var YT=ZT();const Oh=ki(YT),XT=(...e)=>fetch(...e),QT=Symbol.for("lg:fetch_implementation"),KT=()=>globalThis[QT]??XT,JT=[400,401,402,403,404,405,406,407,408,409,422];function WT(e){return e==null||typeof e!="object"?!1:"status"in e&&"statusText"in e&&"text"in e}class Vl extends Error{constructor(t,n,r){super(`HTTP ${t}: ${n}`),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.status=t,this.text=n,this.response=r}static async fromResponse(t,n){try{return new Vl(t.status,await t.text(),n!=null&&n.includeResponse?t:void 0)}catch{return new Vl(t.status,t.statusText,n!=null&&n.includeResponse?t:void 0)}}}class eN{constructor(t){Object.defineProperty(this,"maxConcurrency",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxRetries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"queue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onFailedResponseHook",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"customFetch",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxConcurrency=t.maxConcurrency??1/0,this.maxRetries=t.maxRetries??4,"default"in Oh?this.queue=new Oh.default({concurrency:this.maxConcurrency}):this.queue=new Oh({concurrency:this.maxConcurrency}),this.onFailedResponseHook=t==null?void 0:t.onFailedResponseHook,this.customFetch=t.fetch}call(t,...n){const r=this.onFailedResponseHook;return this.queue.add(()=>UT(()=>t(...n).catch(async s=>{throw s instanceof Error?s:WT(s)?await Vl.fromResponse(s,{includeResponse:!!r}):new Error(s)}),{async onFailedAttempt(s){if(s.message.startsWith("Cancel")||s.message.startsWith("TimeoutError")||s.message.startsWith("AbortError")||(s==null?void 0:s.code)==="ECONNABORTED")throw s;if(s instanceof Vl){if(JT.includes(s.status))throw s;r&&s.response&&await r(s.response)}},retries:this.maxRetries,randomize:!0}),{throwOnTimeout:!0})}callWithOptions(t,n,...r){return t.signal?Promise.race([this.call(n,...r),new Promise((s,l)=>{var o;(o=t.signal)==null||o.addEventListener("abort",()=>{l(new Error("AbortError"))})})]):this.call(n,...r)}fetch(...t){const n=this.customFetch??KT();return this.call(()=>n(...t).then(r=>r.ok?r:Promise.reject(r)))}}var Mh={};function tN(e){try{return typeof process<"u"?Mh==null?void 0:Mh[e]:void 0}catch{return}}function nN(...e){const t=e.filter(r=>r!=null);if(t.length===0)return;if(t.length===1)return t[0];const n=new AbortController;for(const r of e){if(r!=null&&r.aborted)return n.abort(r.reason),n.signal;r==null||r.addEventListener("abort",()=>n.abort(r.reason),{once:!0})}return n.signal}const zl=13,gg=10,rN=0,Fv=58,iN=32,aN=[zl,gg];class Pv extends TransformStream{constructor(){let t=[],n=!1;super({start(){t=[],n=!1},transform(r,s){let l=r;if(n&&(l=rc([[zl],l]),n=!1),l.length>0&&l.at(-1)===zl&&(n=!0,l=l.subarray(0,-1)),!l.length)return;const o=aN.includes(l.at(-1)),c=l.length-1,{lines:f}=l.reduce((d,p,g)=>(d.from>g||((p===zl||p===gg)&&(d.lines.push(l.subarray(d.from,g)),p===zl&&l[g+1]===gg?d.from=g+2:d.from=g+1),g===c&&d.from<=c&&d.lines.push(l.subarray(d.from))),d),{lines:[],from:0});if(f.length===1&&!o){t.push(f[0]);return}t.length&&(t.push(f[0]),f[0]=rc(t),t=[]),o||f.length&&(t=[f.pop()]);for(const d of f)s.enqueue(d)},flush(r){t.length&&r.enqueue(rc(t))}})}}class Uv extends TransformStream{constructor(){let t="",n=[],r="",s=null;const l=new TextDecoder;super({transform(o,c){if(!o.length){if(!t&&!n.length&&!r&&s==null)return;const g={id:r||void 0,event:t,data:n.length?Hv(l,n):null};t="",n=[],s=null,c.enqueue(g);return}if(o[0]===Fv)return;const f=o.indexOf(Fv);if(f===-1)return;const d=l.decode(o.subarray(0,f));let p=o.subarray(f+1);if(p[0]===iN&&(p=p.subarray(1)),d==="event")t=l.decode(p);else if(d==="data")n.push(p);else if(d==="id")p.indexOf(rN)===-1&&(r=l.decode(p));else if(d==="retry"){const g=Number.parseInt(l.decode(p));Number.isNaN(g)||(s=g)}},flush(o){t&&o.enqueue({id:r||void 0,event:t,data:n.length?Hv(l,n):null})}})}}function rc(e){const t=e.reduce((s,l)=>s+l.length,0);let n=new Uint8Array(t),r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function Hv(e,t){return JSON.parse(e.decode(rc(t)))}class ql extends ReadableStream{constructor(){super(...arguments),Object.defineProperty(this,"reader",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}ensureReader(){this.reader||(this.reader=this.getReader())}async next(){this.ensureReader();try{const t=await this.reader.read();return t.done?(this.reader.releaseLock(),{done:!0,value:void 0}):{done:!1,value:t.value}}catch(t){throw this.reader.releaseLock(),t}}async return(){if(this.ensureReader(),this.locked){const t=this.reader.cancel();this.reader.releaseLock(),await t}return{done:!0,value:void 0}}async throw(t){if(this.ensureReader(),this.locked){const n=this.reader.cancel();this.reader.releaseLock(),await n}throw t}async[Symbol.asyncDispose](){await this.return()}[Symbol.asyncIterator](){return this}static fromReadableStream(t){const n=t.getReader();return new ql({start(r){return s();function s(){return n.read().then(({done:l,value:o})=>{if(l){r.close();return}return r.enqueue(o),s()})}},cancel(){n.releaseLock()}})}static fromAsyncGenerator(t){return new ql({async pull(n){const{value:r,done:s}=await t.next();s&&n.close(),n.enqueue(r)},async cancel(n){await t.return(n)}})}}function sN(e){if(e)return e;const t=["LANGGRAPH","LANGSMITH","LANGCHAIN"];for(const n of t){const r=tN(`${n}_API_KEY`);if(r)return r.trim().replace(/^["']|["']$/g,"")}}const lN=/(\/threads\/(?<thread_id>.+))?\/runs\/(?<run_id>.+)/;function Rh(e){var r;const t=e.headers.get("Content-Location");if(!t)return;const n=lN.exec(t);if((r=n==null?void 0:n.groups)!=null&&r.run_id)return{run_id:n.groups.run_id,thread_id:n.groups.thread_id||void 0}}class vs{constructor(t){var l;Object.defineProperty(this,"asyncCaller",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timeoutMs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"defaultHeaders",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const n={maxRetries:4,maxConcurrency:4,...t==null?void 0:t.callerOptions};let r="http://localhost:8123";if(!(t!=null&&t.apiUrl)&&typeof globalThis=="object"&&globalThis!=null){const o=Symbol.for("langgraph_api:fetch"),c=Symbol.for("langgraph_api:url"),f=globalThis;f[o]&&(n.fetch??(n.fetch=f[o])),f[c]&&(r=f[c])}this.asyncCaller=new eN(n),this.timeoutMs=t==null?void 0:t.timeoutMs,this.apiUrl=((l=t==null?void 0:t.apiUrl)==null?void 0:l.replace(/\/$/,""))||r,this.defaultHeaders=(t==null?void 0:t.defaultHeaders)||{};const s=sN(t==null?void 0:t.apiKey);s&&(this.defaultHeaders["X-Api-Key"]=s)}prepareFetchOptions(t,n){const r={...n,headers:{...this.defaultHeaders,...n==null?void 0:n.headers}};r.json&&(r.body=JSON.stringify(r.json),r.headers={...r.headers,"Content-Type":"application/json"},delete r.json),r.withResponse&&delete r.withResponse;let s=null;typeof(n==null?void 0:n.timeoutMs)<"u"?n.timeoutMs!=null&&(s=AbortSignal.timeout(n.timeoutMs)):this.timeoutMs!=null&&(s=AbortSignal.timeout(this.timeoutMs)),r.signal=nN(s,r.signal);const l=new URL(`${this.apiUrl}${t}`);if(r.params){for(const[o,c]of Object.entries(r.params)){if(c==null)continue;let f=typeof c=="string"||typeof c=="number"?c.toString():JSON.stringify(c);l.searchParams.append(o,f)}delete r.params}return[l,r]}async fetch(t,n){const r=await this.asyncCaller.fetch(...this.prepareFetchOptions(t,n)),s=(()=>{if(!(r.status===202||r.status===204))return r.json()})();return n!=null&&n.withResponse?[await s,r]:s}}class oN extends vs{async createForThread(t,n,r){const s={schedule:r==null?void 0:r.schedule,input:r==null?void 0:r.input,config:r==null?void 0:r.config,metadata:r==null?void 0:r.metadata,assistant_id:n,interrupt_before:r==null?void 0:r.interruptBefore,interrupt_after:r==null?void 0:r.interruptAfter,webhook:r==null?void 0:r.webhook,multitask_strategy:r==null?void 0:r.multitaskStrategy,if_not_exists:r==null?void 0:r.ifNotExists,checkpoint_during:r==null?void 0:r.checkpointDuring};return this.fetch(`/threads/${t}/runs/crons`,{method:"POST",json:s})}async create(t,n){const r={schedule:n==null?void 0:n.schedule,input:n==null?void 0:n.input,config:n==null?void 0:n.config,metadata:n==null?void 0:n.metadata,assistant_id:t,interrupt_before:n==null?void 0:n.interruptBefore,interrupt_after:n==null?void 0:n.interruptAfter,webhook:n==null?void 0:n.webhook,multitask_strategy:n==null?void 0:n.multitaskStrategy,if_not_exists:n==null?void 0:n.ifNotExists,checkpoint_during:n==null?void 0:n.checkpointDuring};return this.fetch("/runs/crons",{method:"POST",json:r})}async delete(t){await this.fetch(`/runs/crons/${t}`,{method:"DELETE"})}async search(t){return this.fetch("/runs/crons/search",{method:"POST",json:{assistant_id:(t==null?void 0:t.assistantId)??void 0,thread_id:(t==null?void 0:t.threadId)??void 0,limit:(t==null?void 0:t.limit)??10,offset:(t==null?void 0:t.offset)??0}})}}class uN extends vs{async get(t){return this.fetch(`/assistants/${t}`)}async getGraph(t,n){return this.fetch(`/assistants/${t}/graph`,{params:{xray:n==null?void 0:n.xray}})}async getSchemas(t){return this.fetch(`/assistants/${t}/schemas`)}async getSubgraphs(t,n){return n!=null&&n.namespace?this.fetch(`/assistants/${t}/subgraphs/${n.namespace}`,{params:{recurse:n==null?void 0:n.recurse}}):this.fetch(`/assistants/${t}/subgraphs`,{params:{recurse:n==null?void 0:n.recurse}})}async create(t){return this.fetch("/assistants",{method:"POST",json:{graph_id:t.graphId,config:t.config,metadata:t.metadata,assistant_id:t.assistantId,if_exists:t.ifExists,name:t.name,description:t.description}})}async update(t,n){return this.fetch(`/assistants/${t}`,{method:"PATCH",json:{graph_id:n.graphId,config:n.config,metadata:n.metadata,name:n.name,description:n.description}})}async delete(t){return this.fetch(`/assistants/${t}`,{method:"DELETE"})}async search(t){return this.fetch("/assistants/search",{method:"POST",json:{graph_id:(t==null?void 0:t.graphId)??void 0,metadata:(t==null?void 0:t.metadata)??void 0,limit:(t==null?void 0:t.limit)??10,offset:(t==null?void 0:t.offset)??0,sort_by:(t==null?void 0:t.sortBy)??void 0,sort_order:(t==null?void 0:t.sortOrder)??void 0}})}async getVersions(t,n){return this.fetch(`/assistants/${t}/versions`,{method:"POST",json:{metadata:(n==null?void 0:n.metadata)??void 0,limit:(n==null?void 0:n.limit)??10,offset:(n==null?void 0:n.offset)??0}})}async setLatest(t,n){return this.fetch(`/assistants/${t}/latest`,{method:"POST",json:{version:n}})}}class cN extends vs{async get(t){return this.fetch(`/threads/${t}`)}async create(t){var n;return this.fetch("/threads",{method:"POST",json:{metadata:{...t==null?void 0:t.metadata,graph_id:t==null?void 0:t.graphId},thread_id:t==null?void 0:t.threadId,if_exists:t==null?void 0:t.ifExists,supersteps:(n=t==null?void 0:t.supersteps)==null?void 0:n.map(r=>({updates:r.updates.map(s=>({values:s.values,command:s.command,as_node:s.asNode}))}))}})}async copy(t){return this.fetch(`/threads/${t}/copy`,{method:"POST"})}async update(t,n){return this.fetch(`/threads/${t}`,{method:"PATCH",json:{metadata:n==null?void 0:n.metadata}})}async delete(t){return this.fetch(`/threads/${t}`,{method:"DELETE"})}async search(t){return this.fetch("/threads/search",{method:"POST",json:{metadata:(t==null?void 0:t.metadata)??void 0,limit:(t==null?void 0:t.limit)??10,offset:(t==null?void 0:t.offset)??0,status:t==null?void 0:t.status,sort_by:t==null?void 0:t.sortBy,sort_order:t==null?void 0:t.sortOrder}})}async getState(t,n,r){return n!=null?typeof n!="string"?this.fetch(`/threads/${t}/state/checkpoint`,{method:"POST",json:{checkpoint:n,subgraphs:r==null?void 0:r.subgraphs}}):this.fetch(`/threads/${t}/state/${n}`,{params:{subgraphs:r==null?void 0:r.subgraphs}}):this.fetch(`/threads/${t}/state`,{params:{subgraphs:r==null?void 0:r.subgraphs}})}async updateState(t,n){return this.fetch(`/threads/${t}/state`,{method:"POST",json:{values:n.values,checkpoint_id:n.checkpointId,checkpoint:n.checkpoint,as_node:n==null?void 0:n.asNode}})}async patchState(t,n){var s;let r;if(typeof t!="string"){if(typeof((s=t.configurable)==null?void 0:s.thread_id)!="string")throw new Error("Thread ID is required when updating state with a config.");r=t.configurable.thread_id}else r=t;return this.fetch(`/threads/${r}/state`,{method:"PATCH",json:{metadata:n}})}async getHistory(t,n){return this.fetch(`/threads/${t}/history`,{method:"POST",json:{limit:(n==null?void 0:n.limit)??10,before:n==null?void 0:n.before,metadata:n==null?void 0:n.metadata,checkpoint:n==null?void 0:n.checkpoint}})}}class fN extends vs{async*stream(t,n,r){var d;const s={input:r==null?void 0:r.input,command:r==null?void 0:r.command,config:r==null?void 0:r.config,metadata:r==null?void 0:r.metadata,stream_mode:r==null?void 0:r.streamMode,stream_subgraphs:r==null?void 0:r.streamSubgraphs,stream_resumable:r==null?void 0:r.streamResumable,feedback_keys:r==null?void 0:r.feedbackKeys,assistant_id:n,interrupt_before:r==null?void 0:r.interruptBefore,interrupt_after:r==null?void 0:r.interruptAfter,checkpoint:r==null?void 0:r.checkpoint,checkpoint_id:r==null?void 0:r.checkpointId,webhook:r==null?void 0:r.webhook,multitask_strategy:r==null?void 0:r.multitaskStrategy,on_completion:r==null?void 0:r.onCompletion,on_disconnect:r==null?void 0:r.onDisconnect,after_seconds:r==null?void 0:r.afterSeconds,if_not_exists:r==null?void 0:r.ifNotExists,checkpoint_during:r==null?void 0:r.checkpointDuring},l=t==null?"/runs/stream":`/threads/${t}/runs/stream`,o=await this.asyncCaller.fetch(...this.prepareFetchOptions(l,{method:"POST",json:s,timeoutMs:null,signal:r==null?void 0:r.signal})),c=Rh(o);c&&((d=r==null?void 0:r.onRunCreated)==null||d.call(r,c));const f=(o.body||new ReadableStream({start:p=>p.close()})).pipeThrough(new Pv).pipeThrough(new Uv);yield*ql.fromReadableStream(f)}async create(t,n,r){var f;const s={input:r==null?void 0:r.input,command:r==null?void 0:r.command,config:r==null?void 0:r.config,metadata:r==null?void 0:r.metadata,stream_mode:r==null?void 0:r.streamMode,stream_subgraphs:r==null?void 0:r.streamSubgraphs,stream_resumable:r==null?void 0:r.streamResumable,assistant_id:n,interrupt_before:r==null?void 0:r.interruptBefore,interrupt_after:r==null?void 0:r.interruptAfter,webhook:r==null?void 0:r.webhook,checkpoint:r==null?void 0:r.checkpoint,checkpoint_id:r==null?void 0:r.checkpointId,multitask_strategy:r==null?void 0:r.multitaskStrategy,after_seconds:r==null?void 0:r.afterSeconds,if_not_exists:r==null?void 0:r.ifNotExists,checkpoint_during:r==null?void 0:r.checkpointDuring},[l,o]=await this.fetch(`/threads/${t}/runs`,{method:"POST",json:s,signal:r==null?void 0:r.signal,withResponse:!0}),c=Rh(o);return c&&((f=r==null?void 0:r.onRunCreated)==null||f.call(r,c)),l}async createBatch(t){const n=t.map(r=>({...r,assistant_id:r.assistantId})).map(r=>Object.fromEntries(Object.entries(r).filter(([s,l])=>l!==void 0)));return this.fetch("/runs/batch",{method:"POST",json:n})}async wait(t,n,r){var p,g,m;const s={input:r==null?void 0:r.input,command:r==null?void 0:r.command,config:r==null?void 0:r.config,metadata:r==null?void 0:r.metadata,assistant_id:n,interrupt_before:r==null?void 0:r.interruptBefore,interrupt_after:r==null?void 0:r.interruptAfter,checkpoint:r==null?void 0:r.checkpoint,checkpoint_id:r==null?void 0:r.checkpointId,webhook:r==null?void 0:r.webhook,multitask_strategy:r==null?void 0:r.multitaskStrategy,on_completion:r==null?void 0:r.onCompletion,on_disconnect:r==null?void 0:r.onDisconnect,after_seconds:r==null?void 0:r.afterSeconds,if_not_exists:r==null?void 0:r.ifNotExists,checkpoint_during:r==null?void 0:r.checkpointDuring},l=t==null?"/runs/wait":`/threads/${t}/runs/wait`,[o,c]=await this.fetch(l,{method:"POST",json:s,timeoutMs:null,signal:r==null?void 0:r.signal,withResponse:!0}),f=Rh(c);if(f&&((p=r==null?void 0:r.onRunCreated)==null||p.call(r,f)),((r==null?void 0:r.raiseError)!==void 0?r.raiseError:!0)&&"__error__"in o&&typeof o.__error__=="object"&&o.__error__&&"error"in o.__error__&&"message"in o.__error__)throw new Error(`${(g=o.__error__)==null?void 0:g.error}: ${(m=o.__error__)==null?void 0:m.message}`);return o}async list(t,n){return this.fetch(`/threads/${t}/runs`,{params:{limit:(n==null?void 0:n.limit)??10,offset:(n==null?void 0:n.offset)??0,status:(n==null?void 0:n.status)??void 0}})}async get(t,n){return this.fetch(`/threads/${t}/runs/${n}`)}async cancel(t,n,r=!1,s="interrupt"){return this.fetch(`/threads/${t}/runs/${n}/cancel`,{method:"POST",params:{wait:r?"1":"0",action:s}})}async join(t,n,r){return this.fetch(`/threads/${t}/runs/${n}/join`,{timeoutMs:null,signal:r==null?void 0:r.signal})}async*joinStream(t,n,r){const s=typeof r=="object"&&r!=null&&r instanceof AbortSignal?{signal:r}:r,o=((await this.asyncCaller.fetch(...this.prepareFetchOptions(t!=null?`/threads/${t}/runs/${n}/stream`:`/runs/${n}/stream`,{method:"GET",timeoutMs:null,signal:s==null?void 0:s.signal,headers:s!=null&&s.lastEventId?{"Last-Event-ID":s.lastEventId}:void 0,params:{cancel_on_disconnect:s!=null&&s.cancelOnDisconnect?"1":"0",stream_mode:s==null?void 0:s.streamMode}}))).body||new ReadableStream({start:c=>c.close()})).pipeThrough(new Pv).pipeThrough(new Uv);yield*ql.fromReadableStream(o)}async delete(t,n){return this.fetch(`/threads/${t}/runs/${n}`,{method:"DELETE"})}}class dN extends vs{async putItem(t,n,r,s){t.forEach(o=>{if(o.includes("."))throw new Error(`Invalid namespace label '${o}'. Namespace labels cannot contain periods ('.')`)});const l={namespace:t,key:n,value:r,index:s==null?void 0:s.index,ttl:s==null?void 0:s.ttl};return this.fetch("/store/items",{method:"PUT",json:l})}async getItem(t,n,r){t.forEach(o=>{if(o.includes("."))throw new Error(`Invalid namespace label '${o}'. Namespace labels cannot contain periods ('.')`)});const s={namespace:t.join("."),key:n};(r==null?void 0:r.refreshTtl)!==void 0&&(s.refresh_ttl=r.refreshTtl);const l=await this.fetch("/store/items",{params:s});return l?{...l,createdAt:l.created_at,updatedAt:l.updated_at}:null}async deleteItem(t,n){return t.forEach(r=>{if(r.includes("."))throw new Error(`Invalid namespace label '${r}'. Namespace labels cannot contain periods ('.')`)}),this.fetch("/store/items",{method:"DELETE",json:{namespace:t,key:n}})}async searchItems(t,n){const r={namespace_prefix:t,filter:n==null?void 0:n.filter,limit:(n==null?void 0:n.limit)??10,offset:(n==null?void 0:n.offset)??0,query:n==null?void 0:n.query,refresh_ttl:n==null?void 0:n.refreshTtl};return{items:(await this.fetch("/store/items/search",{method:"POST",json:r})).items.map(l=>({...l,createdAt:l.created_at,updatedAt:l.updated_at}))}}async listNamespaces(t){const n={prefix:t==null?void 0:t.prefix,suffix:t==null?void 0:t.suffix,max_depth:t==null?void 0:t.maxDepth,limit:(t==null?void 0:t.limit)??100,offset:(t==null?void 0:t.offset)??0};return this.fetch("/store/namespaces",{method:"POST",json:n})}}class Ki extends vs{static getOrCached(t,n){if(Ki.promiseCache[t]!=null)return Ki.promiseCache[t];const r=n();return Ki.promiseCache[t]=r,r}async getComponent(t,n){return Ki.getOrCached(`${this.apiUrl}-${t}-${n}`,async()=>(await this.asyncCaller.fetch(...this.prepareFetchOptions(`/ui/${t}`,{headers:{Accept:"text/html","Content-Type":"application/json"},method:"POST",json:{name:n}}))).text())}}Object.defineProperty(Ki,"promiseCache",{enumerable:!0,configurable:!0,writable:!0,value:{}});class hN{constructor(t){Object.defineProperty(this,"assistants",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"threads",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"runs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"crons",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"store",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"~ui",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.assistants=new uN(t),this.threads=new cN(t),this.runs=new fN(t),this.crons=new oN(t),this.store=new dN(t),this["~ui"]=new Ki(t)}}var Xe;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const l={};for(const o of s)l[o]=o;return l},e.getValidEnumValues=s=>{const l=e.objectKeys(s).filter(c=>typeof s[s[c]]!="number"),o={};for(const c of l)o[c]=s[c];return e.objectValues(o)},e.objectValues=s=>e.objectKeys(s).map(function(l){return s[l]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const l=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&l.push(o);return l},e.find=(s,l)=>{for(const o of s)if(l(o))return o},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,l=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(l)}e.joinValues=r,e.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Xe||(Xe={}));var $v;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})($v||($v={}));const we=Xe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),mi=e=>{switch(typeof e){case"undefined":return we.undefined;case"string":return we.string;case"number":return Number.isNaN(e)?we.nan:we.number;case"boolean":return we.boolean;case"function":return we.function;case"bigint":return we.bigint;case"symbol":return we.symbol;case"object":return Array.isArray(e)?we.array:e===null?we.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?we.promise:typeof Map<"u"&&e instanceof Map?we.map:typeof Set<"u"&&e instanceof Set?we.set:typeof Date<"u"&&e instanceof Date?we.date:we.object;default:return we.unknown}},ge=Xe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class jr extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(l){return l.message},r={_errors:[]},s=l=>{for(const o of l.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let c=r,f=0;for(;f<o.path.length;){const d=o.path[f];f===o.path.length-1?(c[d]=c[d]||{_errors:[]},c[d]._errors.push(n(o))):c[d]=c[d]||{_errors:[]},c=c[d],f++}}};return s(this),r}static assert(t){if(!(t instanceof jr))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Xe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}jr.create=e=>new jr(e);const mg=(e,t)=>{let n;switch(e.code){case ge.invalid_type:e.received===we.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ge.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Xe.jsonStringifyReplacer)}`;break;case ge.unrecognized_keys:n=`Unrecognized key(s) in object: ${Xe.joinValues(e.keys,", ")}`;break;case ge.invalid_union:n="Invalid input";break;case ge.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Xe.joinValues(e.options)}`;break;case ge.invalid_enum_value:n=`Invalid enum value. Expected ${Xe.joinValues(e.options)}, received '${e.received}'`;break;case ge.invalid_arguments:n="Invalid function arguments";break;case ge.invalid_return_type:n="Invalid function return type";break;case ge.invalid_date:n="Invalid date";break;case ge.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Xe.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ge.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ge.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ge.custom:n="Invalid input";break;case ge.invalid_intersection_types:n="Intersection results could not be merged";break;case ge.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ge.not_finite:n="Number must be finite";break;default:n=t.defaultError,Xe.assertNever(e)}return{message:n}};let pN=mg;function gN(){return pN}const mN=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,l=[...n,...s.path||[]],o={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let c="";const f=r.filter(d=>!!d).slice().reverse();for(const d of f)c=d(o,{data:t,defaultError:c}).message;return{...s,path:l,message:c}};function ve(e,t){const n=gN(),r=mN({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===mg?void 0:mg].filter(s=>!!s)});e.common.issues.push(r)}class wn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return De;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const l=await s.key,o=await s.value;r.push({key:l,value:o})}return wn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:l,value:o}=s;if(l.status==="aborted"||o.status==="aborted")return De;l.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),l.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[l.value]=o.value)}return{status:t.value,value:r}}}const De=Object.freeze({status:"aborted"}),Ll=e=>({status:"dirty",value:e}),Rn=e=>({status:"valid",value:e}),Vv=e=>e.status==="aborted",qv=e=>e.status==="dirty",ss=e=>e.status==="valid",dc=e=>typeof Promise<"u"&&e instanceof Promise;var _e;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(_e||(_e={}));class _i{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Gv=(e,t)=>{if(ss(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new jr(e.common.issues);return this._error=n,this._error}}};function Pe(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(o,c)=>{const{message:f}=e;return o.code==="invalid_enum_value"?{message:f??c.defaultError}:typeof c.data>"u"?{message:f??r??c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:f??n??c.defaultError}},description:s}}class Ze{get description(){return this._def.description}_getType(t){return mi(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:mi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new wn,ctx:{common:t.parent.common,data:t.data,parsedType:mi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(dc(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:mi(t)},s=this._parseSync({data:t,path:r.path,parent:r});return Gv(r,s)}"~validate"(t){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:mi(t)};if(!this["~standard"].async)try{const l=this._parseSync({data:t,path:[],parent:n});return ss(l)?{value:l.value}:{issues:n.common.issues}}catch(l){(s=(r=l==null?void 0:l.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(l=>ss(l)?{value:l.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:mi(t)},s=this._parse({data:t,path:r.path,parent:r}),l=await(dc(s)?s:Promise.resolve(s));return Gv(r,l)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const o=t(s),c=()=>l.addIssue({code:ge.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(f=>f?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new us({schema:this,typeName:me.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Rr.create(this,this._def)}nullable(){return cs.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ar.create(this)}promise(){return mc.create(this,this._def)}or(t){return pc.create([this,t],this._def)}and(t){return gc.create(this,t,this._def)}transform(t){return new us({...Pe(this._def),schema:this,typeName:me.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new vg({...Pe(this._def),innerType:this,defaultValue:n,typeName:me.ZodDefault})}brand(){return new FN({typeName:me.ZodBranded,type:this,...Pe(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new xg({...Pe(this._def),innerType:this,catchValue:n,typeName:me.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return im.create(this,t)}readonly(){return wg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const yN=/^c[^\s-]{8,}$/i,bN=/^[0-9a-z]+$/,vN=/^[0-9A-HJKMNP-TV-Z]{26}$/i,xN=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,wN=/^[a-z0-9_-]{21}$/i,_N=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,SN=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,kN=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,EN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Dh;const AN=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,TN=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,NN=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,CN=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ON=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,MN=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,T_="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",RN=new RegExp(`^${T_}$`);function N_(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function DN(e){return new RegExp(`^${N_(e)}$`)}function jN(e){let t=`${T_}T${N_(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function zN(e,t){return!!((t==="v4"||!t)&&AN.test(e)||(t==="v6"||!t)&&NN.test(e))}function LN(e,t){if(!_N.test(e))return!1;try{const[n]=e.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function IN(e,t){return!!((t==="v4"||!t)&&TN.test(e)||(t==="v6"||!t)&&CN.test(e))}class vi extends Ze{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==we.string){const l=this._getOrReturnCtx(t);return ve(l,{code:ge.invalid_type,expected:we.string,received:l.parsedType}),De}const r=new wn;let s;for(const l of this._def.checks)if(l.kind==="min")t.data.length<l.value&&(s=this._getOrReturnCtx(t,s),ve(s,{code:ge.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),r.dirty());else if(l.kind==="max")t.data.length>l.value&&(s=this._getOrReturnCtx(t,s),ve(s,{code:ge.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),r.dirty());else if(l.kind==="length"){const o=t.data.length>l.value,c=t.data.length<l.value;(o||c)&&(s=this._getOrReturnCtx(t,s),o?ve(s,{code:ge.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):c&&ve(s,{code:ge.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),r.dirty())}else if(l.kind==="email")kN.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"email",code:ge.invalid_string,message:l.message}),r.dirty());else if(l.kind==="emoji")Dh||(Dh=new RegExp(EN,"u")),Dh.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"emoji",code:ge.invalid_string,message:l.message}),r.dirty());else if(l.kind==="uuid")xN.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"uuid",code:ge.invalid_string,message:l.message}),r.dirty());else if(l.kind==="nanoid")wN.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"nanoid",code:ge.invalid_string,message:l.message}),r.dirty());else if(l.kind==="cuid")yN.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"cuid",code:ge.invalid_string,message:l.message}),r.dirty());else if(l.kind==="cuid2")bN.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"cuid2",code:ge.invalid_string,message:l.message}),r.dirty());else if(l.kind==="ulid")vN.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"ulid",code:ge.invalid_string,message:l.message}),r.dirty());else if(l.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),ve(s,{validation:"url",code:ge.invalid_string,message:l.message}),r.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"regex",code:ge.invalid_string,message:l.message}),r.dirty())):l.kind==="trim"?t.data=t.data.trim():l.kind==="includes"?t.data.includes(l.value,l.position)||(s=this._getOrReturnCtx(t,s),ve(s,{code:ge.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),r.dirty()):l.kind==="toLowerCase"?t.data=t.data.toLowerCase():l.kind==="toUpperCase"?t.data=t.data.toUpperCase():l.kind==="startsWith"?t.data.startsWith(l.value)||(s=this._getOrReturnCtx(t,s),ve(s,{code:ge.invalid_string,validation:{startsWith:l.value},message:l.message}),r.dirty()):l.kind==="endsWith"?t.data.endsWith(l.value)||(s=this._getOrReturnCtx(t,s),ve(s,{code:ge.invalid_string,validation:{endsWith:l.value},message:l.message}),r.dirty()):l.kind==="datetime"?jN(l).test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{code:ge.invalid_string,validation:"datetime",message:l.message}),r.dirty()):l.kind==="date"?RN.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{code:ge.invalid_string,validation:"date",message:l.message}),r.dirty()):l.kind==="time"?DN(l).test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{code:ge.invalid_string,validation:"time",message:l.message}),r.dirty()):l.kind==="duration"?SN.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"duration",code:ge.invalid_string,message:l.message}),r.dirty()):l.kind==="ip"?zN(t.data,l.version)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"ip",code:ge.invalid_string,message:l.message}),r.dirty()):l.kind==="jwt"?LN(t.data,l.alg)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"jwt",code:ge.invalid_string,message:l.message}),r.dirty()):l.kind==="cidr"?IN(t.data,l.version)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"cidr",code:ge.invalid_string,message:l.message}),r.dirty()):l.kind==="base64"?ON.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"base64",code:ge.invalid_string,message:l.message}),r.dirty()):l.kind==="base64url"?MN.test(t.data)||(s=this._getOrReturnCtx(t,s),ve(s,{validation:"base64url",code:ge.invalid_string,message:l.message}),r.dirty()):Xe.assertNever(l);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:ge.invalid_string,..._e.errToObj(r)})}_addCheck(t){return new vi({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",..._e.errToObj(t)})}url(t){return this._addCheck({kind:"url",..._e.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",..._e.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",..._e.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",..._e.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",..._e.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",..._e.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",..._e.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",..._e.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",..._e.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",..._e.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",..._e.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",..._e.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,..._e.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,..._e.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",..._e.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,..._e.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,..._e.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,..._e.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,..._e.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,..._e.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,..._e.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,..._e.errToObj(n)})}nonempty(t){return this.min(1,_e.errToObj(t))}trim(){return new vi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new vi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new vi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}vi.create=e=>new vi({checks:[],typeName:me.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Pe(e)});function BN(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,l=Number.parseInt(e.toFixed(s).replace(".","")),o=Number.parseInt(t.toFixed(s).replace(".",""));return l%o/10**s}class ls extends Ze{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==we.number){const l=this._getOrReturnCtx(t);return ve(l,{code:ge.invalid_type,expected:we.number,received:l.parsedType}),De}let r;const s=new wn;for(const l of this._def.checks)l.kind==="int"?Xe.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ve(r,{code:ge.invalid_type,expected:"integer",received:"float",message:l.message}),s.dirty()):l.kind==="min"?(l.inclusive?t.data<l.value:t.data<=l.value)&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ge.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?t.data>l.value:t.data>=l.value)&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ge.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?BN(t.data,l.value)!==0&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ge.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ve(r,{code:ge.not_finite,message:l.message}),s.dirty()):Xe.assertNever(l);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,_e.toString(n))}gt(t,n){return this.setLimit("min",t,!1,_e.toString(n))}lte(t,n){return this.setLimit("max",t,!0,_e.toString(n))}lt(t,n){return this.setLimit("max",t,!1,_e.toString(n))}setLimit(t,n,r,s){return new ls({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:_e.toString(s)}]})}_addCheck(t){return new ls({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:_e.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_e.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_e.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_e.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_e.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:_e.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:_e.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_e.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_e.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Xe.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}ls.create=e=>new ls({checks:[],typeName:me.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Pe(e)});class Gl extends Ze{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==we.bigint)return this._getInvalidInput(t);let r;const s=new wn;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?t.data<l.value:t.data<=l.value)&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ge.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?t.data>l.value:t.data>=l.value)&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ge.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="multipleOf"?t.data%l.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ge.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):Xe.assertNever(l);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return ve(n,{code:ge.invalid_type,expected:we.bigint,received:n.parsedType}),De}gte(t,n){return this.setLimit("min",t,!0,_e.toString(n))}gt(t,n){return this.setLimit("min",t,!1,_e.toString(n))}lte(t,n){return this.setLimit("max",t,!0,_e.toString(n))}lt(t,n){return this.setLimit("max",t,!1,_e.toString(n))}setLimit(t,n,r,s){return new Gl({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:_e.toString(s)}]})}_addCheck(t){return new Gl({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_e.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_e.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_e.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_e.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:_e.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Gl.create=e=>new Gl({checks:[],typeName:me.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Pe(e)});class yg extends Ze{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==we.boolean){const r=this._getOrReturnCtx(t);return ve(r,{code:ge.invalid_type,expected:we.boolean,received:r.parsedType}),De}return Rn(t.data)}}yg.create=e=>new yg({typeName:me.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Pe(e)});class hc extends Ze{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==we.date){const l=this._getOrReturnCtx(t);return ve(l,{code:ge.invalid_type,expected:we.date,received:l.parsedType}),De}if(Number.isNaN(t.data.getTime())){const l=this._getOrReturnCtx(t);return ve(l,{code:ge.invalid_date}),De}const r=new wn;let s;for(const l of this._def.checks)l.kind==="min"?t.data.getTime()<l.value&&(s=this._getOrReturnCtx(t,s),ve(s,{code:ge.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),r.dirty()):l.kind==="max"?t.data.getTime()>l.value&&(s=this._getOrReturnCtx(t,s),ve(s,{code:ge.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),r.dirty()):Xe.assertNever(l);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new hc({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:_e.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:_e.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}hc.create=e=>new hc({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:me.ZodDate,...Pe(e)});class Zv extends Ze{_parse(t){if(this._getType(t)!==we.symbol){const r=this._getOrReturnCtx(t);return ve(r,{code:ge.invalid_type,expected:we.symbol,received:r.parsedType}),De}return Rn(t.data)}}Zv.create=e=>new Zv({typeName:me.ZodSymbol,...Pe(e)});class Yv extends Ze{_parse(t){if(this._getType(t)!==we.undefined){const r=this._getOrReturnCtx(t);return ve(r,{code:ge.invalid_type,expected:we.undefined,received:r.parsedType}),De}return Rn(t.data)}}Yv.create=e=>new Yv({typeName:me.ZodUndefined,...Pe(e)});class Xv extends Ze{_parse(t){if(this._getType(t)!==we.null){const r=this._getOrReturnCtx(t);return ve(r,{code:ge.invalid_type,expected:we.null,received:r.parsedType}),De}return Rn(t.data)}}Xv.create=e=>new Xv({typeName:me.ZodNull,...Pe(e)});class Qv extends Ze{constructor(){super(...arguments),this._any=!0}_parse(t){return Rn(t.data)}}Qv.create=e=>new Qv({typeName:me.ZodAny,...Pe(e)});class Kv extends Ze{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Rn(t.data)}}Kv.create=e=>new Kv({typeName:me.ZodUnknown,...Pe(e)});class Si extends Ze{_parse(t){const n=this._getOrReturnCtx(t);return ve(n,{code:ge.invalid_type,expected:we.never,received:n.parsedType}),De}}Si.create=e=>new Si({typeName:me.ZodNever,...Pe(e)});class Jv extends Ze{_parse(t){if(this._getType(t)!==we.undefined){const r=this._getOrReturnCtx(t);return ve(r,{code:ge.invalid_type,expected:we.void,received:r.parsedType}),De}return Rn(t.data)}}Jv.create=e=>new Jv({typeName:me.ZodVoid,...Pe(e)});class ar extends Ze{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==we.array)return ve(n,{code:ge.invalid_type,expected:we.array,received:n.parsedType}),De;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,c=n.data.length<s.exactLength.value;(o||c)&&(ve(n,{code:o?ge.too_big:ge.too_small,minimum:c?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ve(n,{code:ge.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ve(n,{code:ge.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,c)=>s.type._parseAsync(new _i(n,o,n.path,c)))).then(o=>wn.mergeArray(r,o));const l=[...n.data].map((o,c)=>s.type._parseSync(new _i(n,o,n.path,c)));return wn.mergeArray(r,l)}get element(){return this._def.type}min(t,n){return new ar({...this._def,minLength:{value:t,message:_e.toString(n)}})}max(t,n){return new ar({...this._def,maxLength:{value:t,message:_e.toString(n)}})}length(t,n){return new ar({...this._def,exactLength:{value:t,message:_e.toString(n)}})}nonempty(t){return this.min(1,t)}}ar.create=(e,t)=>new ar({type:e,minLength:null,maxLength:null,exactLength:null,typeName:me.ZodArray,...Pe(t)});function Ja(e){if(e instanceof At){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Rr.create(Ja(r))}return new At({...e._def,shape:()=>t})}else return e instanceof ar?new ar({...e._def,type:Ja(e.element)}):e instanceof Rr?Rr.create(Ja(e.unwrap())):e instanceof cs?cs.create(Ja(e.unwrap())):e instanceof ra?ra.create(e.items.map(t=>Ja(t))):e}class At extends Ze{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Xe.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==we.object){const d=this._getOrReturnCtx(t);return ve(d,{code:ge.invalid_type,expected:we.object,received:d.parsedType}),De}const{status:r,ctx:s}=this._processInputParams(t),{shape:l,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof Si&&this._def.unknownKeys==="strip"))for(const d in s.data)o.includes(d)||c.push(d);const f=[];for(const d of o){const p=l[d],g=s.data[d];f.push({key:{status:"valid",value:d},value:p._parse(new _i(s,g,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof Si){const d=this._def.unknownKeys;if(d==="passthrough")for(const p of c)f.push({key:{status:"valid",value:p},value:{status:"valid",value:s.data[p]}});else if(d==="strict")c.length>0&&(ve(s,{code:ge.unrecognized_keys,keys:c}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const p of c){const g=s.data[p];f.push({key:{status:"valid",value:p},value:d._parse(new _i(s,g,s.path,p)),alwaysSet:p in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const p of f){const g=await p.key,m=await p.value;d.push({key:g,value:m,alwaysSet:p.alwaysSet})}return d}).then(d=>wn.mergeObjectSync(r,d)):wn.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(t){return _e.errToObj,new At({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var l,o;const s=((o=(l=this._def).errorMap)==null?void 0:o.call(l,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:_e.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new At({...this._def,unknownKeys:"strip"})}passthrough(){return new At({...this._def,unknownKeys:"passthrough"})}extend(t){return new At({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new At({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:me.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new At({...this._def,catchall:t})}pick(t){const n={};for(const r of Xe.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new At({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Xe.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new At({...this._def,shape:()=>n})}deepPartial(){return Ja(this)}partial(t){const n={};for(const r of Xe.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new At({...this._def,shape:()=>n})}required(t){const n={};for(const r of Xe.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let l=this.shape[r];for(;l instanceof Rr;)l=l._def.innerType;n[r]=l}return new At({...this._def,shape:()=>n})}keyof(){return C_(Xe.objectKeys(this.shape))}}At.create=(e,t)=>new At({shape:()=>e,unknownKeys:"strip",catchall:Si.create(),typeName:me.ZodObject,...Pe(t)});At.strictCreate=(e,t)=>new At({shape:()=>e,unknownKeys:"strict",catchall:Si.create(),typeName:me.ZodObject,...Pe(t)});At.lazycreate=(e,t)=>new At({shape:e,unknownKeys:"strip",catchall:Si.create(),typeName:me.ZodObject,...Pe(t)});class pc extends Ze{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(l){for(const c of l)if(c.result.status==="valid")return c.result;for(const c of l)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;const o=l.map(c=>new jr(c.ctx.common.issues));return ve(n,{code:ge.invalid_union,unionErrors:o}),De}if(n.common.async)return Promise.all(r.map(async l=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let l;const o=[];for(const f of r){const d={...n,common:{...n.common,issues:[]},parent:null},p=f._parseSync({data:n.data,path:n.path,parent:d});if(p.status==="valid")return p;p.status==="dirty"&&!l&&(l={result:p,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const c=o.map(f=>new jr(f));return ve(n,{code:ge.invalid_union,unionErrors:c}),De}}get options(){return this._def.options}}pc.create=(e,t)=>new pc({options:e,typeName:me.ZodUnion,...Pe(t)});function bg(e,t){const n=mi(e),r=mi(t);if(e===t)return{valid:!0,data:e};if(n===we.object&&r===we.object){const s=Xe.objectKeys(t),l=Xe.objectKeys(e).filter(c=>s.indexOf(c)!==-1),o={...e,...t};for(const c of l){const f=bg(e[c],t[c]);if(!f.valid)return{valid:!1};o[c]=f.data}return{valid:!0,data:o}}else if(n===we.array&&r===we.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let l=0;l<e.length;l++){const o=e[l],c=t[l],f=bg(o,c);if(!f.valid)return{valid:!1};s.push(f.data)}return{valid:!0,data:s}}else return n===we.date&&r===we.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class gc extends Ze{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(l,o)=>{if(Vv(l)||Vv(o))return De;const c=bg(l.value,o.value);return c.valid?((qv(l)||qv(o))&&n.dirty(),{status:n.value,value:c.data}):(ve(r,{code:ge.invalid_intersection_types}),De)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([l,o])=>s(l,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}gc.create=(e,t,n)=>new gc({left:e,right:t,typeName:me.ZodIntersection,...Pe(n)});class ra extends Ze{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==we.array)return ve(r,{code:ge.invalid_type,expected:we.array,received:r.parsedType}),De;if(r.data.length<this._def.items.length)return ve(r,{code:ge.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),De;!this._def.rest&&r.data.length>this._def.items.length&&(ve(r,{code:ge.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...r.data].map((o,c)=>{const f=this._def.items[c]||this._def.rest;return f?f._parse(new _i(r,o,r.path,c)):null}).filter(o=>!!o);return r.common.async?Promise.all(l).then(o=>wn.mergeArray(n,o)):wn.mergeArray(n,l)}get items(){return this._def.items}rest(t){return new ra({...this._def,rest:t})}}ra.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ra({items:e,typeName:me.ZodTuple,rest:null,...Pe(t)})};class Wv extends Ze{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==we.map)return ve(r,{code:ge.invalid_type,expected:we.map,received:r.parsedType}),De;const s=this._def.keyType,l=this._def.valueType,o=[...r.data.entries()].map(([c,f],d)=>({key:s._parse(new _i(r,c,r.path,[d,"key"])),value:l._parse(new _i(r,f,r.path,[d,"value"]))}));if(r.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const f of o){const d=await f.key,p=await f.value;if(d.status==="aborted"||p.status==="aborted")return De;(d.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(d.value,p.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const f of o){const d=f.key,p=f.value;if(d.status==="aborted"||p.status==="aborted")return De;(d.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(d.value,p.value)}return{status:n.value,value:c}}}}Wv.create=(e,t,n)=>new Wv({valueType:t,keyType:e,typeName:me.ZodMap,...Pe(n)});class Zl extends Ze{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==we.set)return ve(r,{code:ge.invalid_type,expected:we.set,received:r.parsedType}),De;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(ve(r,{code:ge.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(ve(r,{code:ge.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function o(f){const d=new Set;for(const p of f){if(p.status==="aborted")return De;p.status==="dirty"&&n.dirty(),d.add(p.value)}return{status:n.value,value:d}}const c=[...r.data.values()].map((f,d)=>l._parse(new _i(r,f,r.path,d)));return r.common.async?Promise.all(c).then(f=>o(f)):o(c)}min(t,n){return new Zl({...this._def,minSize:{value:t,message:_e.toString(n)}})}max(t,n){return new Zl({...this._def,maxSize:{value:t,message:_e.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Zl.create=(e,t)=>new Zl({valueType:e,minSize:null,maxSize:null,typeName:me.ZodSet,...Pe(t)});class ex extends Ze{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}ex.create=(e,t)=>new ex({getter:e,typeName:me.ZodLazy,...Pe(t)});class tx extends Ze{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ve(n,{received:n.data,code:ge.invalid_literal,expected:this._def.value}),De}return{status:"valid",value:t.data}}get value(){return this._def.value}}tx.create=(e,t)=>new tx({value:e,typeName:me.ZodLiteral,...Pe(t)});function C_(e,t){return new os({values:e,typeName:me.ZodEnum,...Pe(t)})}class os extends Ze{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ve(n,{expected:Xe.joinValues(r),received:n.parsedType,code:ge.invalid_type}),De}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return ve(n,{received:n.data,code:ge.invalid_enum_value,options:r}),De}return Rn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return os.create(t,{...this._def,...n})}exclude(t,n=this._def){return os.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}os.create=C_;class nx extends Ze{_parse(t){const n=Xe.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==we.string&&r.parsedType!==we.number){const s=Xe.objectValues(n);return ve(r,{expected:Xe.joinValues(s),received:r.parsedType,code:ge.invalid_type}),De}if(this._cache||(this._cache=new Set(Xe.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=Xe.objectValues(n);return ve(r,{received:r.data,code:ge.invalid_enum_value,options:s}),De}return Rn(t.data)}get enum(){return this._def.values}}nx.create=(e,t)=>new nx({values:e,typeName:me.ZodNativeEnum,...Pe(t)});class mc extends Ze{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==we.promise&&n.common.async===!1)return ve(n,{code:ge.invalid_type,expected:we.promise,received:n.parsedType}),De;const r=n.parsedType===we.promise?n.data:Promise.resolve(n.data);return Rn(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}mc.create=(e,t)=>new mc({type:e,typeName:me.ZodPromise,...Pe(t)});class us extends Ze{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===me.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,l={addIssue:o=>{ve(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const o=s.transform(r.data,l);if(r.common.async)return Promise.resolve(o).then(async c=>{if(n.value==="aborted")return De;const f=await this._def.schema._parseAsync({data:c,path:r.path,parent:r});return f.status==="aborted"?De:f.status==="dirty"||n.value==="dirty"?Ll(f.value):f});{if(n.value==="aborted")return De;const c=this._def.schema._parseSync({data:o,path:r.path,parent:r});return c.status==="aborted"?De:c.status==="dirty"||n.value==="dirty"?Ll(c.value):c}}if(s.type==="refinement"){const o=c=>{const f=s.refinement(c,l);if(r.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?De:(c.status==="dirty"&&n.dirty(),o(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?De:(c.status==="dirty"&&n.dirty(),o(c.value).then(()=>({status:n.value,value:c.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ss(o))return De;const c=s.transform(o.value,l);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>ss(o)?Promise.resolve(s.transform(o.value,l)).then(c=>({status:n.value,value:c})):De);Xe.assertNever(s)}}us.create=(e,t,n)=>new us({schema:e,typeName:me.ZodEffects,effect:t,...Pe(n)});us.createWithPreprocess=(e,t,n)=>new us({schema:t,effect:{type:"preprocess",transform:e},typeName:me.ZodEffects,...Pe(n)});class Rr extends Ze{_parse(t){return this._getType(t)===we.undefined?Rn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Rr.create=(e,t)=>new Rr({innerType:e,typeName:me.ZodOptional,...Pe(t)});class cs extends Ze{_parse(t){return this._getType(t)===we.null?Rn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}cs.create=(e,t)=>new cs({innerType:e,typeName:me.ZodNullable,...Pe(t)});class vg extends Ze{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===we.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}vg.create=(e,t)=>new vg({innerType:e,typeName:me.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Pe(t)});class xg extends Ze{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return dc(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new jr(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new jr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}xg.create=(e,t)=>new xg({innerType:e,typeName:me.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Pe(t)});class rx extends Ze{_parse(t){if(this._getType(t)!==we.nan){const r=this._getOrReturnCtx(t);return ve(r,{code:ge.invalid_type,expected:we.nan,received:r.parsedType}),De}return{status:"valid",value:t.data}}}rx.create=e=>new rx({typeName:me.ZodNaN,...Pe(e)});class FN extends Ze{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class im extends Ze{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?De:l.status==="dirty"?(n.dirty(),Ll(l.value)):this._def.out._parseAsync({data:l.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?De:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new im({in:t,out:n,typeName:me.ZodPipeline})}}class wg extends Ze{_parse(t){const n=this._def.innerType._parse(t),r=s=>(ss(s)&&(s.value=Object.freeze(s.value)),s);return dc(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}wg.create=(e,t)=>new wg({innerType:e,typeName:me.ZodReadonly,...Pe(t)});var me;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(me||(me={}));const PN=vi.create,UN=ls.create,HN=yg.create;Si.create;const $N=ar.create,ic=At.create;pc.create;gc.create;ra.create;os.create;mc.create;Rr.create;cs.create;function VN(e){let t={};for(let r of e||[])t[r.name]=O_(r);let n=[];for(let r of e||[])r.required!==!1&&n.push(r.name);return{type:"object",properties:t,required:n}}function O_(e){var t,n,r;switch(e.type){case"string":return{type:"string",description:e.description,...e.enum&&{enum:e.enum}};case"number":case"boolean":return{type:e.type,description:e.description};case"object":case"object[]":const s=(t=e.attributes)==null?void 0:t.reduce((o,c)=>(o[c.name]=O_(c),o),{}),l=(n=e.attributes)==null?void 0:n.filter(o=>o.required!==!1).map(o=>o.name);return e.type==="object[]"?{type:"array",items:{type:"object",...s&&{properties:s},...l&&l.length>0&&{required:l}},description:e.description}:{type:"object",description:e.description,...s&&{properties:s},...l&&l.length>0&&{required:l}};default:return(r=e.type)!=null&&r.endsWith("[]")?{type:"array",items:{type:e.type.slice(0,-2)},description:e.description}:{type:"string",description:e.description}}}function qN(e){const t={};for(const[n,r]of Object.entries(e.properties))t[n]=_g(r,e.required?e.required.includes(n):!1);return t}function _g(e,t){if(e.type==="object"){const n={};if(!e.properties||!Object.keys(e.properties).length)return t?ic(n):ic(n).optional();for(const[s,l]of Object.entries(e.properties))n[s]=_g(l,e.required?e.required.includes(s):!1);let r=ic(n).describe(e.description);return t?r:r.optional()}else if(e.type==="string"){let n=PN().describe(e.description);return t?n:n.optional()}else if(e.type==="number"){let n=UN().describe(e.description);return t?n:n.optional()}else if(e.type==="boolean"){let n=HN().describe(e.description);return t?n:n.optional()}else if(e.type==="array"){let n=_g(e.items,!0),r=$N(n).describe(e.description);return t?r:r.optional()}throw new Error("Invalid JSON schema")}const GN=Symbol("Let zodToJsonSchema decide on which parser to use"),ZN={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},YN=e=>({...ZN,...e}),XN=e=>{const t=YN(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([r,s])=>[s._def,{def:s._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}};function M_(e,t,n,r){r!=null&&r.errorMessages&&n&&(e.errorMessage={...e.errorMessage,[t]:n})}function tt(e,t,n,r,s){e[t]=n,M_(e,t,r,s)}function QN(){return{}}function KN(e,t){var r,s,l;const n={type:"array"};return(r=e.type)!=null&&r._def&&((l=(s=e.type)==null?void 0:s._def)==null?void 0:l.typeName)!==me.ZodAny&&(n.items=Je(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&tt(n,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&tt(n,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(tt(n,"minItems",e.exactLength.value,e.exactLength.message,t),tt(n,"maxItems",e.exactLength.value,e.exactLength.message,t)),n}function JN(e,t){const n={type:"integer",format:"int64"};if(!e.checks)return n;for(const r of e.checks)switch(r.kind){case"min":t.target==="jsonSchema7"?r.inclusive?tt(n,"minimum",r.value,r.message,t):tt(n,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(n.exclusiveMinimum=!0),tt(n,"minimum",r.value,r.message,t));break;case"max":t.target==="jsonSchema7"?r.inclusive?tt(n,"maximum",r.value,r.message,t):tt(n,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(n.exclusiveMaximum=!0),tt(n,"maximum",r.value,r.message,t));break;case"multipleOf":tt(n,"multipleOf",r.value,r.message,t);break}return n}function WN(){return{type:"boolean"}}function R_(e,t){return Je(e.type._def,t)}const eC=(e,t)=>Je(e.innerType._def,t);function D_(e,t,n){const r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((s,l)=>D_(e,t,s))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return tC(e,t)}}const tC=(e,t)=>{const n={type:"integer",format:"unix-time"};if(t.target==="openApi3")return n;for(const r of e.checks)switch(r.kind){case"min":tt(n,"minimum",r.value,r.message,t);break;case"max":tt(n,"maximum",r.value,r.message,t);break}return n};function nC(e,t){return{...Je(e.innerType._def,t),default:e.defaultValue()}}function rC(e,t){return t.effectStrategy==="input"?Je(e.schema._def,t):{}}function iC(e){return{type:"string",enum:Array.from(e.values)}}const aC=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function sC(e,t){const n=[Je(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),Je(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(l=>!!l);let r=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0;const s=[];return n.forEach(l=>{if(aC(l))s.push(...l.allOf),l.unevaluatedProperties===void 0&&(r=void 0);else{let o=l;if("additionalProperties"in l&&l.additionalProperties===!1){const{additionalProperties:c,...f}=l;o=f}else r=void 0;s.push(o)}}),s.length?{allOf:s,...r}:void 0}function lC(e,t){const n=typeof e.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[e.value]}:{type:n==="bigint"?"integer":n,const:e.value}}let jh;const Fn={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(jh===void 0&&(jh=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),jh),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function j_(e,t){const n={type:"string"};if(e.checks)for(const r of e.checks)switch(r.kind){case"min":tt(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,r.message,t);break;case"max":tt(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case"email":switch(t.emailStrategy){case"format:email":Pn(n,"email",r.message,t);break;case"format:idn-email":Pn(n,"idn-email",r.message,t);break;case"pattern:zod":Xt(n,Fn.email,r.message,t);break}break;case"url":Pn(n,"uri",r.message,t);break;case"uuid":Pn(n,"uuid",r.message,t);break;case"regex":Xt(n,r.regex,r.message,t);break;case"cuid":Xt(n,Fn.cuid,r.message,t);break;case"cuid2":Xt(n,Fn.cuid2,r.message,t);break;case"startsWith":Xt(n,RegExp(`^${zh(r.value,t)}`),r.message,t);break;case"endsWith":Xt(n,RegExp(`${zh(r.value,t)}$`),r.message,t);break;case"datetime":Pn(n,"date-time",r.message,t);break;case"date":Pn(n,"date",r.message,t);break;case"time":Pn(n,"time",r.message,t);break;case"duration":Pn(n,"duration",r.message,t);break;case"length":tt(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,r.message,t),tt(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case"includes":{Xt(n,RegExp(zh(r.value,t)),r.message,t);break}case"ip":{r.version!=="v6"&&Pn(n,"ipv4",r.message,t),r.version!=="v4"&&Pn(n,"ipv6",r.message,t);break}case"base64url":Xt(n,Fn.base64url,r.message,t);break;case"jwt":Xt(n,Fn.jwt,r.message,t);break;case"cidr":{r.version!=="v6"&&Xt(n,Fn.ipv4Cidr,r.message,t),r.version!=="v4"&&Xt(n,Fn.ipv6Cidr,r.message,t);break}case"emoji":Xt(n,Fn.emoji(),r.message,t);break;case"ulid":{Xt(n,Fn.ulid,r.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Pn(n,"binary",r.message,t);break}case"contentEncoding:base64":{tt(n,"contentEncoding","base64",r.message,t);break}case"pattern:zod":{Xt(n,Fn.base64,r.message,t);break}}break}case"nanoid":Xt(n,Fn.nanoid,r.message,t)}return n}function zh(e,t){return t.patternStrategy==="escape"?uC(e):e}const oC=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function uC(e){let t="";for(let n=0;n<e.length;n++)oC.has(e[n])||(t+="\\"),t+=e[n];return t}function Pn(e,t,n,r){var s;e.format||(s=e.anyOf)!=null&&s.some(l=>l.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&r.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):tt(e,"format",t,n,r)}function Xt(e,t,n,r){var s;e.pattern||(s=e.allOf)!=null&&s.some(l=>l.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&r.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:ix(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):tt(e,"pattern",ix(t,r),n,r)}function ix(e,t){var f;if(!t.applyRegexFlags||!e.flags)return e.source;const n={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},r=n.i?e.source.toLowerCase():e.source;let s="",l=!1,o=!1,c=!1;for(let d=0;d<r.length;d++){if(l){s+=r[d],l=!1;continue}if(n.i){if(o){if(r[d].match(/[a-z]/)){c?(s+=r[d],s+=`${r[d-2]}-${r[d]}`.toUpperCase(),c=!1):r[d+1]==="-"&&((f=r[d+2])!=null&&f.match(/[a-z]/))?(s+=r[d],c=!0):s+=`${r[d]}${r[d].toUpperCase()}`;continue}}else if(r[d].match(/[a-z]/)){s+=`[${r[d]}${r[d].toUpperCase()}]`;continue}}if(n.m){if(r[d]==="^"){s+=`(^|(?<=[\r
|
|
50
50
|
]))`;continue}else if(r[d]==="$"){s+=`($|(?=[\r
|
|
51
51
|
]))`;continue}}if(n.s&&r[d]==="."){s+=o?`${r[d]}\r
|
|
52
52
|
`:`[${r[d]}\r
|
|
53
|
-
]`;continue}s+=r[d],r[d]==="\\"?l=!0:o&&r[d]==="]"?o=!1:!o&&r[d]==="["&&(o=!0)}try{new RegExp(s)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return s}function j_(e,t){var r,s,l,o,c,f;if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&((r=e.keyType)==null?void 0:r._def.typeName)===me.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((d,p)=>({...d,[p]:Je(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",p]})??{}}),{}),additionalProperties:t.rejectedAdditionalProperties};const n={type:"object",additionalProperties:Je(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return n;if(((s=e.keyType)==null?void 0:s._def.typeName)===me.ZodString&&((l=e.keyType._def.checks)!=null&&l.length)){const{type:d,...p}=D_(e.keyType._def,t);return{...n,propertyNames:p}}else{if(((o=e.keyType)==null?void 0:o._def.typeName)===me.ZodEnum)return{...n,propertyNames:{enum:e.keyType._def.values}};if(((c=e.keyType)==null?void 0:c._def.typeName)===me.ZodBranded&&e.keyType._def.type._def.typeName===me.ZodString&&((f=e.keyType._def.type._def.checks)!=null&&f.length)){const{type:d,...p}=M_(e.keyType._def,t);return{...n,propertyNames:p}}}return n}function cN(e,t){if(t.mapStrategy==="record")return j_(e,t);const n=Je(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},r=Je(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{};return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function fN(e){const t=e.values,r=Object.keys(e.values).filter(l=>typeof t[t[l]]!="number").map(l=>t[l]),s=Array.from(new Set(r.map(l=>typeof l)));return{type:s.length===1?s[0]==="string"?"string":"number":["string","number"],enum:r}}function dN(){return{not:{}}}function hN(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}const yc={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function pN(e,t){if(t.target==="openApi3")return ix(e,t);const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(r=>r._def.typeName in yc&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((s,l)=>{const o=yc[l._def.typeName];return o&&!s.includes(o)?[...s,o]:s},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((s,l)=>{const o=typeof l._def.value;switch(o){case"string":case"number":case"boolean":return[...s,o];case"bigint":return[...s,"integer"];case"object":if(l._def.value===null)return[...s,"null"];case"symbol":case"undefined":case"function":default:return s}},[]);if(r.length===n.length){const s=r.filter((l,o,c)=>c.indexOf(l)===o);return{type:s.length>1?s:s[0],enum:n.reduce((l,o)=>l.includes(o._def.value)?l:[...l,o._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,s)=>[...r,...s._def.values.filter(l=>!r.includes(l))],[])};return ix(e,t)}const ix=(e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,s)=>Je(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${s}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function gN(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:yc[e.innerType._def.typeName],nullable:!0}:{type:[yc[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){const r=Je(e.innerType._def,{...t,currentPath:[...t.currentPath]});return r&&"$ref"in r?{allOf:[r],nullable:!0}:r&&{...r,nullable:!0}}const n=Je(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function mN(e,t){const n={type:"number"};if(!e.checks)return n;for(const r of e.checks)switch(r.kind){case"int":n.type="integer",O_(n,"type",r.message,t);break;case"min":t.target==="jsonSchema7"?r.inclusive?tt(n,"minimum",r.value,r.message,t):tt(n,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(n.exclusiveMinimum=!0),tt(n,"minimum",r.value,r.message,t));break;case"max":t.target==="jsonSchema7"?r.inclusive?tt(n,"maximum",r.value,r.message,t):tt(n,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(n.exclusiveMaximum=!0),tt(n,"maximum",r.value,r.message,t));break;case"multipleOf":tt(n,"multipleOf",r.value,r.message,t);break}return n}function yN(e,t){const n=t.target==="openAi",r={type:"object",properties:{}},s=[],l=e.shape();for(const c in l){let f=l[c];if(f===void 0||f._def===void 0)continue;let d=vN(f);d&&n&&(f instanceof Rr&&(f=f._def.innerType),f.isNullable()||(f=f.nullable()),d=!1);const p=Je(f._def,{...t,currentPath:[...t.currentPath,"properties",c],propertyPath:[...t.currentPath,"properties",c]});p!==void 0&&(r.properties[c]=p,d||s.push(c))}s.length&&(r.required=s);const o=bN(e,t);return o!==void 0&&(r.additionalProperties=o),r}function bN(e,t){if(e.catchall._def.typeName!=="ZodNever")return Je(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function vN(e){try{return e.isOptional()}catch{return!0}}const xN=(e,t)=>{var r;if(t.currentPath.toString()===((r=t.propertyPath)==null?void 0:r.toString()))return Je(e.innerType._def,t);const n=Je(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:{}},n]}:{}},wN=(e,t)=>{if(t.pipeStrategy==="input")return Je(e.in._def,t);if(t.pipeStrategy==="output")return Je(e.out._def,t);const n=Je(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=Je(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(s=>s!==void 0)}};function _N(e,t){return Je(e.type._def,t)}function SN(e,t){const r={type:"array",uniqueItems:!0,items:Je(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&tt(r,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&tt(r,"maxItems",e.maxSize.value,e.maxSize.message,t),r}function kN(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>Je(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Je(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>Je(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function EN(){return{not:{}}}function AN(){return{}}const TN=(e,t)=>Je(e.innerType._def,t),CN=(e,t,n)=>{switch(t){case me.ZodString:return D_(e,n);case me.ZodNumber:return mN(e,n);case me.ZodObject:return yN(e,n);case me.ZodBigInt:return JC(e,n);case me.ZodBoolean:return WC();case me.ZodDate:return R_(e,n);case me.ZodUndefined:return EN();case me.ZodNull:return hN(n);case me.ZodArray:return KC(e,n);case me.ZodUnion:case me.ZodDiscriminatedUnion:return pN(e,n);case me.ZodIntersection:return sN(e,n);case me.ZodTuple:return kN(e,n);case me.ZodRecord:return j_(e,n);case me.ZodLiteral:return lN(e,n);case me.ZodEnum:return iN(e);case me.ZodNativeEnum:return fN(e);case me.ZodNullable:return gN(e,n);case me.ZodOptional:return xN(e,n);case me.ZodMap:return cN(e,n);case me.ZodSet:return SN(e,n);case me.ZodLazy:return()=>e.getter()._def;case me.ZodPromise:return _N(e,n);case me.ZodNaN:case me.ZodNever:return dN();case me.ZodEffects:return rN(e,n);case me.ZodAny:return QC();case me.ZodUnknown:return AN();case me.ZodDefault:return nN(e,n);case me.ZodBranded:return M_(e,n);case me.ZodReadonly:return TN(e,n);case me.ZodCatch:return eN(e,n);case me.ZodPipeline:return wN(e,n);case me.ZodFunction:case me.ZodVoid:case me.ZodSymbol:return;default:return(r=>{})()}};function Je(e,t,n=!1){var c;const r=t.seen.get(e);if(t.override){const f=(c=t.override)==null?void 0:c.call(t,e,t,r,n);if(f!==GC)return f}if(r&&!n){const f=NN(r,t);if(f!==void 0)return f}const s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);const l=CN(e,e.typeName,t),o=typeof l=="function"?Je(l(),t):l;if(o&&MN(e,t,o),t.postProcess){const f=t.postProcess(o,e,t);return s.jsonSchema=o,f}return s.jsonSchema=o,o}const NN=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:ON(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,r)=>t.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{}):t.$refStrategy==="seen"?{}:void 0}},ON=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")},MN=(e,t,n)=>(e.description&&(n.description=e.description,t.markdownDescription&&(n.markdownDescription=e.description)),n),RN=(e,t)=>{const n=XC(t),r=void 0,s=t==null?void 0:t.name,l=Je(e._def,n,!1)??{},o=s===void 0?r?{...l,[n.definitionPath]:r}:l:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,s].join("/"),[n.definitionPath]:{...r,[s]:l}};return n.target==="jsonSchema7"?o.$schema="http://json-schema.org/draft-07/schema#":(n.target==="jsonSchema2019-09"||n.target==="openAi")&&(o.$schema="https://json-schema.org/draft/2019-09/schema#"),n.target==="openAi"&&("anyOf"in o||"oneOf"in o||"allOf"in o||"type"in o&&Array.isArray(o.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),o},DN=e=>({render:e.render,onlyRender:e.onlyRender,name:e.name,description:e.description||"",parameters:qC(VC(e.parameters||[])),returnDirect:e.returnDirect,callbackMessage:e.callbackMessage,allowAgent:e.allowAgent,allowGraph:e.allowGraph,async execute(t,n){var r;try{const s=await((r=e.handler)==null?void 0:r.call(e,t,n));return typeof s=="string"?[{type:"text",text:s}]:[{type:"text",text:JSON.stringify(s)}]}catch(s){return[{type:"text",text:`Error: ${s}`}]}}}),jN=e=>({name:e.name,description:e.description,parameters:e.isPureParams?e.parameters:RN(ic(e.parameters))}),fs=DN;class z_{constructor(){this.tools=new Map,this.waitingMap=new Map}bindTool(t){if(this.tools.has(t.name))throw new Error(`Tool with name ${t.name} already exists`);this.tools.set(t.name,t)}bindTools(t){t.forEach(n=>this.bindTool(n))}getAllTools(){return Array.from(this.tools.values())}getTool(t){return this.tools.get(t)}removeTool(t){return this.tools.delete(t)}clearTools(){this.tools.clear()}reset(){this.clearTools(),this.clearWaiting()}clearWaiting(){this.waitingMap.clear()}async callTool(t,n,r){var l;const s=this.getTool(t);if(!s)throw new Error(`Tool with name ${t} not found`);return await((l=s.execute)==null?void 0:l.call(s,n,r))}async toJSON(t,n=!0){return Array.from(this.tools.values()).filter(r=>n?!r.onlyRender:!0).filter(r=>!r.allowGraph||r.allowGraph.includes(t)).map(r=>jN(r))}doneWaiting(t,n){return this.waitingMap.has(t)?(this.waitingMap.get(t)(n),this.waitingMap.delete(t),!0):(console.warn(`Waiting for tool ${t} not found`),!1)}waitForDone(t){return this.waitingMap.has(t)?this.waitingMap.get(t):new Promise((r,s)=>{this.waitingMap.set(t,r)})}static waitForUIDone(t,n){return n.client.tools.waitForDone(n.message.id)}}class Lh{static isUser(t){return t.type==="human"}static isTool(t){return t.type==="tool"}static isAssistant(t){return t.type==="ai"&&!this.isToolAssistant(t)}static isToolAssistant(t){var n,r;return t.type==="ai"&&(((n=t.tool_calls)==null?void 0:n.length)||((r=t.tool_call_chunks)==null?void 0:r.length))}}class zN extends hC{constructor(t){super(t),this.currentAssistant=null,this.currentThread=null,this.streamingCallbacks=new Set,this.tools=new z_,this.stopController=null,this.availableAssistants=[],this.streamingMessage=[],this.graphMessages=[],this.graphState={},this.graphPosition="",this.extraParams={}}listAssistants(){return this.assistants.search({metadata:null,offset:0,limit:100})}async initAssistant(t){try{const n=await this.listAssistants();if(this.availableAssistants=n,n.length>0)if(t){if(this.currentAssistant=n.find(r=>r.graph_id===t)||null,!this.currentAssistant)throw new Error("Agent not found: "+t)}else this.currentAssistant=n[0];else throw new Error("No assistants found")}catch(n){throw console.error("Failed to initialize LangGraphClient:",n),n}}async createThread({threadId:t}={}){try{return this.currentThread=await this.threads.create({threadId:t}),this.currentThread}catch(n){throw console.error("Failed to create new thread:",n),n}}graphVisualize(){var t;return this.assistants.getGraph((t=this.currentAssistant)==null?void 0:t.assistant_id,{xray:!0})}async listThreads(){return this.threads.search({sortOrder:"desc"})}async resetThread(t,n){var r;return await this.initAssistant(t),this.currentThread=await this.threads.get(n),this.graphState=this.currentThread.values,this.graphMessages=((r=this.graphState)==null?void 0:r.messages)||[],this.emitStreamingUpdate({type:"value",data:{event:"messages/partial",data:{messages:this.graphMessages}}}),this.currentThread}async resetStream(){const t=await this.runs.list(this.currentThread.thread_id),n=t==null?void 0:t.find(r=>r.status==="running"||r.status==="pending");n&&await this.sendMessage([],{joinRunId:n.run_id})}cloneMessage(t){return JSON.parse(JSON.stringify(t))}updateStreamingMessage(t){const n=this.streamingMessage[this.streamingMessage.length-1];if(!(n!=null&&n.id)||t.id!==n.id){this.streamingMessage.push(t);return}this.streamingMessage[this.streamingMessage.length-1]=t}combineGraphMessagesWithStreamingMessages(){const t=new Map(this.streamingMessage.map(n=>[n.id,n]));return[...this.graphMessages.map(n=>{if(t.has(n.id)){const r=t.get(n.id);return t.delete(n.id),r}return n}),...t.values()]}get renderMessage(){var l;const t=new Map,n=new Set,r=[],s=this.combineGraphMessagesWithStreamingMessages();for(let o=s.length-1;o>=0;o--){const c=this.cloneMessage(s[o]);if(!c.id){r.unshift(c);continue}if(c.type==="ai"&&(c.name||(c.name=this.getGraphNodeNow().name)),Lh.isToolAssistant(c)){const f=c;t.set(c.id,f);const p=((l=f.tool_calls)!=null&&l.length?f.tool_calls:f.tool_call_chunks).filter(g=>!n.has(g.id)).map((g,m)=>{var b,x,w,_;return{type:"tool",additional_kwargs:{},tool_input:(_=(w=(x=(b=f.additional_kwargs)==null?void 0:b.tool_calls)==null?void 0:x[m])==null?void 0:w.function)==null?void 0:_.arguments,id:g.id,name:g.name,response_metadata:{},tool_call_id:g.id,content:""}});for(const g of p)t.has(g.id)||(r.unshift(g),t.set(g.id,g));r.unshift(f)}else c.type==="tool"&&c.tool_call_id&&n.add(c.tool_call_id),t.set(c.id,c),r.unshift(c)}return this.attachInfoForMessage(this.composeToolMessages(r))}attachInfoForMessage(t){var r,s,l;let n=null;for(const o of t){const c=((r=o.response_metadata)==null?void 0:r.create_time)||"";if(o.unique_id=o.tool_call_id||o.id,o.spend_time=new Date(c).getTime()-new Date(((s=n==null?void 0:n.response_metadata)==null?void 0:s.create_time)||c).getTime(),!o.usage_metadata&&((l=o.response_metadata)!=null&&l.usage)){const f=o.response_metadata.usage;o.usage_metadata={...f,input_tokens:f.prompt_tokens,output_tokens:f.completion_tokens,total_tokens:f.total_tokens}}n=o}return t}composeToolMessages(t){var l,o;const n=[],r=new Map,s=new Map;for(const c of t)if(!(Lh.isToolAssistant(c)&&((l=c.tool_calls||c.tool_call_chunks)==null||l.forEach(f=>{r.set(f.id,f),s.set(f.id,c)}),!c.content))){if(Lh.isTool(c)&&!c.tool_input){const f=r.get(c.tool_call_id),d=s.get(c.tool_call_id);f&&(c.tool_input=typeof f.args!="string"?JSON.stringify(f.args):f.args,c.additional_kwargs?(c.additional_kwargs.done=!0,c.done=!0):(c.done=!0,c.additional_kwargs={done:!0})),d&&(c.usage_metadata=d.usage_metadata,c.node_name=d.name,c.name||(c.name=(o=d.tool_calls.find(p=>p.id===c.tool_call_id))==null?void 0:o.name))}n.push(c)}return n}get tokenCounter(){return this.graphMessages.reduce((t,n)=>{var r,s,l,o,c;if(n.usage_metadata)t.total_tokens+=((r=n.usage_metadata)==null?void 0:r.total_tokens)||0,t.input_tokens+=((s=n.usage_metadata)==null?void 0:s.input_tokens)||0,t.output_tokens+=((l=n.usage_metadata)==null?void 0:l.output_tokens)||0;else if((o=n.response_metadata)!=null&&o.usage){const f=(c=n.response_metadata)==null?void 0:c.usage;t.total_tokens+=f.total_tokens||0,t.input_tokens+=f.prompt_tokens||0,t.output_tokens+=f.completion_tokens||0}return t},{total_tokens:0,input_tokens:0,output_tokens:0})}onStreamingUpdate(t){return this.streamingCallbacks.add(t),()=>{this.streamingCallbacks.delete(t)}}emitStreamingUpdate(t){this.streamingCallbacks.forEach(n=>n(t))}isFELocking(t){var s;const n=t[t.length-1];if(!n)return!1;const r=this.tools.getTool(n==null?void 0:n.name);return r&&r.render&&(n==null?void 0:n.type)==="tool"&&!((s=n==null?void 0:n.additional_kwargs)!=null&&s.done)}cancelRun(){var t,n;(t=this.currentThread)!=null&&t.thread_id&&((n=this.currentRun)!=null&&n.run_id)&&this.runs.cancel(this.currentThread.thread_id,this.currentRun.run_id)}async sendMessage(t,{joinRunId:n,extraParams:r,_debug:s,command:l}={}){var g;if(!this.currentAssistant)throw new Error("Thread or Assistant not initialized");this.currentThread||(await this.createThread(),this.emitStreamingUpdate({type:"thread",data:{event:"thread/create",data:{thread:this.currentThread}}}));const o=Array.isArray(t)?t:[{type:"human",content:t}],f=await(async()=>s!=null&&s.streamResponse?s.streamResponse:n?this.runs.joinStream(this.currentThread.thread_id,n):this.runs.stream(this.currentThread.thread_id,this.currentAssistant.assistant_id,{input:{...this.graphState,...this.extraParams,...r||{},messages:o,fe_tools:await this.tools.toJSON(this.currentAssistant.graph_id)},streamMode:["messages","values"],streamSubgraphs:!0,command:l}))(),d=[];this.emitStreamingUpdate({type:"start",data:{event:"start"}});for await(const m of f)if(d.push(m),m.event==="metadata")this.currentRun=m.data;else if(m.event==="error")this.emitStreamingUpdate({type:"error",data:m});else if(m.event==="messages/partial"){for(const b of m.data)this.updateStreamingMessage(b);this.emitStreamingUpdate({type:"message",data:m});continue}else if(m.event==="values"){const b=m.data;if(b.messages){const x=!!(l!=null&&l.resume),w=b.messages.length>=this.graphMessages.length;(!x||x&&w)&&(this.graphMessages=b.messages,this.emitStreamingUpdate({type:"value",data:m})),this.graphState=m.data}continue}else m.event.startsWith("values|")&&((g=m.data)!=null&&g.messages&&this.mergeSubGraphMessagesToStreamingMessages(m.data.messages),this.graphPosition=m.event.split("|")[1]);const p=await this.runFETool();return p&&d.push(...p),this.emitStreamingUpdate({type:"done",data:{event:"done"}}),this.streamingMessage=[],d}getGraphPosition(){return this.graphPosition.split("|").map(t=>{const[n,r]=t.split(":");return{id:r,name:n}})}getGraphNodeNow(){const t=this.getGraphPosition();return t[t.length-1]}mergeSubGraphMessagesToStreamingMessages(t){const n=new Map(t.filter(r=>r.id).map(r=>[r.id,r]));this.streamingMessage.forEach(r=>{if(n.has(r.id)){const s=n.get(r.id);Object.assign(r,s),n.delete(r.id)}}),n.forEach(r=>{r.type==="tool"&&r.tool_call_id&&this.streamingMessage.push(r)})}runFETool(){var r;const t=this.streamingMessage,n=t[t.length-1];if(n&&n.type==="ai"&&(r=n.tool_calls)!=null&&r.length){const s=n.tool_calls.map(l=>{if(this.tools.getTool(l.name)){const o={...l,tool_call_id:l.id,tool_input:JSON.stringify(l.args),additional_kwargs:{}};return this.callFETool(o,l.args)}});return this.currentThread.status="interrupted",Promise.all(s)}}async callFETool(t,n){const r=this,s=await this.tools.callTool(t.name,n,{client:r,message:t});if(s)return this.resume(s)}resume(t){return this.sendMessage([],{command:{resume:t}})}doneFEToolWaiting(t,n){var s;!this.tools.doneWaiting(t,n)&&((s=this.currentThread)==null?void 0:s.status)==="interrupted"&&this.resume(n)}getCurrentThread(){return this.currentThread}getCurrentAssistant(){return this.currentAssistant}async reset(){var t;await this.initAssistant((t=this.currentAssistant)==null?void 0:t.graph_id),this.currentThread=null,this.graphState={},this.graphMessages=[],this.streamingMessage=[],this.currentRun=void 0,this.tools.clearWaiting(),this.emitStreamingUpdate({type:"value",data:{event:"messages/partial"}})}}let Un=[],di=0;const Fu=4;let an=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},lc:0,listen(r){return n.lc=t.push(r),()=>{for(let l=di+Fu;l<Un.length;)Un[l]===r?Un.splice(l,Fu):l+=Fu;let s=t.indexOf(r);~s&&(t.splice(s,1),--n.lc)}},notify(r,s){let l=!Un.length;for(let o of t)Un.push(o,n.value,r,s);if(l){for(di=0;di<Un.length;di+=Fu)Un[di](Un[di+1],Un[di+2],Un[di+3]);Un.length=0}},off(){},set(r){let s=n.value;s!==r&&(n.value=r,n.notify(s))},subscribe(r){let s=n.listen(r);return r(n.value),s},value:e};return n};function LN(e,t,n){let r=new Set(t).add(void 0);return e.listen((s,l,o)=>{r.has(o)&&n(s,l,o)})}function IN(e,t,n){var r,s,l;n===void 0&&(n={});var o=(r=n.isImmediate)!=null&&r,c=(s=n.callback)!=null&&s,f=n.maxWait,d=Date.now(),p=[];function g(){if(f!==void 0){var b=Date.now()-d;if(b+t>=f)return f-b}return t}var m=function(){var b=[].slice.call(arguments),x=this;return new Promise(function(w,_){var k=o&&l===void 0;if(l!==void 0&&clearTimeout(l),l=setTimeout(function(){if(l=void 0,d=Date.now(),!o){var S=e.apply(x,b);c&&c(S),p.forEach(function(O){return(0,O.resolve)(S)}),p=[]}},g()),k){var A=e.apply(x,b);return c&&c(A),w(A)}p.push({resolve:w,reject:_})})};return m.cancel=function(b){l!==void 0&&clearTimeout(l),p.forEach(function(x){return(0,x.reject)(b)}),p=[]},m}const BN=e=>e.toLocaleTimeString("en-US"),FN=e=>e.toLocaleString("en"),am=e=>typeof e=="string"?e:Array.isArray(e)?e.map(t=>typeof t=="string"?t:t.type==="text"?t.text:t.type==="image_url"?"[图片]":JSON.stringify(t)).join(""):JSON.stringify(e),PN=e=>{var n,r,s;const t=(s=(r=(n=e==null?void 0:e.values)==null?void 0:n.messages)==null?void 0:r[0])==null?void 0:s.content;return t&&Array.isArray(t)?t.map(l=>{if(l.type==="text")return l.text}):typeof t=="string"?t:""},UN=(e,t,n={})=>{const r=an(null),s=an([]),l=an(""),o=an(!1),c=an([]),f=an(null),d=an(n.showHistory??!1),p=an(e),g=an(null),m=an("__start__"),b=an([]),x=async()=>{const B=r.get();B&&(B.tools.clearTools(),B.tools.bindTools(b.get()))},w=an(n.showGraph??!1),_=an(null),k=async()=>{var B;w.get()&&_.set(await((B=r.get())==null?void 0:B.graphVisualize())||null)},A=IN(B=>{const q=B.renderMessage,R=q[q.length-1];m.set((R==null?void 0:R.node_name)||(R==null?void 0:R.name)||"__start__"),s.set(q)},10);async function S(){var q;const B=new zN(t);return await B.initAssistant(p.get()),p.set(B.getCurrentAssistant().graph_id),f.set(null),B.onStreamingUpdate(R=>{var $;if(g.set((($=B.getCurrentThread())==null?void 0:$.thread_id)||null),R.type==="start"&&o.set(!0),R.type==="thread"||R.type==="done")return m.set("__start__"),R.type==="done"&&o.set(!1),U();R.type==="error"&&(o.set(!1),f.set(R.data)),A(B)}),(q=n.onInit)==null||q.call(n,B),B.graphState={},r.set(B),w.get()&&k(),x(),B}const O=async(B,q)=>{var R;!l.get().trim()&&!(B!=null&&B.length)||o.get()||!r.get()||(o.set(!0),f.set(null),await((R=r.get())==null?void 0:R.sendMessage(B||l.get(),q)),l.set(""),o.set(!1))},D=()=>{var B;(B=r.get())==null||B.cancelRun()},M=B=>{const q=c.get();c.set(q.includes(B)?q.filter(R=>R!==B):[...q,B])},F=()=>{d.set(!d.get()),d.get()&&U()},L=an([]),U=async()=>{var B;if(!(!r.get()||!d.get()))try{const q=await((B=r.get())==null?void 0:B.listThreads());L.set(q||[])}catch(q){console.error("Failed to fetch threads:",q)}};return{data:{client:r,renderMessages:s,userInput:l,loading:o,inChatError:f,currentAgent:p,collapsedTools:c,showHistory:d,historyList:L,currentChatId:g,showGraph:w,graphVisualize:_,currentNodeName:m,tools:b},mutations:{refreshTools:x,setTools(B){b.set(B),x()},isFELocking(){var B;return(B=r.get())==null?void 0:B.isFELocking(s.get())},initClient:S,sendMessage:O,stopGeneration:D,toggleToolCollapse:M,toggleHistoryVisible:F,refreshHistoryList:U,addToHistory:B=>{const q=L.get();L.set([B,...q])},setUserInput(B){l.set(B)},setCurrentAgent(B){return p.set(B),S().then(()=>{d.get()&&U()})},toggleGraphVisible(){w.set(!w.get()),w.get()&&k()},refreshGraph:k,createNewChat(){var B;(B=r.get())==null||B.reset(),f.set(null),o.set(!1)},async toHistoryChat(B){var R,$,I;f.set(null),o.set(!1);const q=await(($=r.get())==null?void 0:$.resetThread((R=B.metadata)==null?void 0:R.graph_id,B.thread_id));return q&&((I=r.get())==null||I.resetStream()),q},async deleteHistoryChat(B){var q;await((q=r.get())==null?void 0:q.threads.delete(B.thread_id)),await U()},getToolUIRender:B=>{var $;const R=($=r.get().tools.getAllTools().find(I=>I.name===B))==null?void 0:$.render;return R?I=>R(new lO(I,r.get())):null}}}};class Za extends Error{constructor(t,n){super("".concat(t," at position ").concat(n)),this.position=n}}const L_=32,HN=10,I_=9,B_=13,$N=160,VN=8192,qN=8202,GN=8239,ZN=8287,YN=12288;function XN(e){return/^[0-9A-Fa-f]$/.test(e)}function Gi(e){return e>="0"&&e<="9"}function QN(e){return e>=" "}function Pu(e){return`,:[]/{}()
|
|
54
|
-
+`.includes(e)}function
|
|
55
|
-
+`.includes(e)}function
|
|
56
|
-
`||e==="\r"||e===" "||e==="\b"||e==="\f"}function Xi(e,t){const n=e.charCodeAt(t);return n===
|
|
57
|
-
`,r:"\r",t:" "};function aO(e){let t=0,n="";d(),l()||q(),d();const s=p(",");for(s&&o(),
|
|
58
|
-
`;)t++;return!0}return!1}function d(){if(e.slice(t,t+3)==="```"){if(t+=3,
|
|
53
|
+
]`;continue}s+=r[d],r[d]==="\\"?l=!0:o&&r[d]==="]"?o=!1:!o&&r[d]==="["&&(o=!0)}try{new RegExp(s)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return s}function z_(e,t){var r,s,l,o,c,f;if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&((r=e.keyType)==null?void 0:r._def.typeName)===me.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((d,p)=>({...d,[p]:Je(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",p]})??{}}),{}),additionalProperties:t.rejectedAdditionalProperties};const n={type:"object",additionalProperties:Je(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return n;if(((s=e.keyType)==null?void 0:s._def.typeName)===me.ZodString&&((l=e.keyType._def.checks)!=null&&l.length)){const{type:d,...p}=j_(e.keyType._def,t);return{...n,propertyNames:p}}else{if(((o=e.keyType)==null?void 0:o._def.typeName)===me.ZodEnum)return{...n,propertyNames:{enum:e.keyType._def.values}};if(((c=e.keyType)==null?void 0:c._def.typeName)===me.ZodBranded&&e.keyType._def.type._def.typeName===me.ZodString&&((f=e.keyType._def.type._def.checks)!=null&&f.length)){const{type:d,...p}=R_(e.keyType._def,t);return{...n,propertyNames:p}}}return n}function cC(e,t){if(t.mapStrategy==="record")return z_(e,t);const n=Je(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},r=Je(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{};return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function fC(e){const t=e.values,r=Object.keys(e.values).filter(l=>typeof t[t[l]]!="number").map(l=>t[l]),s=Array.from(new Set(r.map(l=>typeof l)));return{type:s.length===1?s[0]==="string"?"string":"number":["string","number"],enum:r}}function dC(){return{not:{}}}function hC(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}const yc={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function pC(e,t){if(t.target==="openApi3")return ax(e,t);const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(r=>r._def.typeName in yc&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((s,l)=>{const o=yc[l._def.typeName];return o&&!s.includes(o)?[...s,o]:s},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((s,l)=>{const o=typeof l._def.value;switch(o){case"string":case"number":case"boolean":return[...s,o];case"bigint":return[...s,"integer"];case"object":if(l._def.value===null)return[...s,"null"];case"symbol":case"undefined":case"function":default:return s}},[]);if(r.length===n.length){const s=r.filter((l,o,c)=>c.indexOf(l)===o);return{type:s.length>1?s:s[0],enum:n.reduce((l,o)=>l.includes(o._def.value)?l:[...l,o._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,s)=>[...r,...s._def.values.filter(l=>!r.includes(l))],[])};return ax(e,t)}const ax=(e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,s)=>Je(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${s}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function gC(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:yc[e.innerType._def.typeName],nullable:!0}:{type:[yc[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){const r=Je(e.innerType._def,{...t,currentPath:[...t.currentPath]});return r&&"$ref"in r?{allOf:[r],nullable:!0}:r&&{...r,nullable:!0}}const n=Je(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function mC(e,t){const n={type:"number"};if(!e.checks)return n;for(const r of e.checks)switch(r.kind){case"int":n.type="integer",M_(n,"type",r.message,t);break;case"min":t.target==="jsonSchema7"?r.inclusive?tt(n,"minimum",r.value,r.message,t):tt(n,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(n.exclusiveMinimum=!0),tt(n,"minimum",r.value,r.message,t));break;case"max":t.target==="jsonSchema7"?r.inclusive?tt(n,"maximum",r.value,r.message,t):tt(n,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(n.exclusiveMaximum=!0),tt(n,"maximum",r.value,r.message,t));break;case"multipleOf":tt(n,"multipleOf",r.value,r.message,t);break}return n}function yC(e,t){const n=t.target==="openAi",r={type:"object",properties:{}},s=[],l=e.shape();for(const c in l){let f=l[c];if(f===void 0||f._def===void 0)continue;let d=vC(f);d&&n&&(f instanceof Rr&&(f=f._def.innerType),f.isNullable()||(f=f.nullable()),d=!1);const p=Je(f._def,{...t,currentPath:[...t.currentPath,"properties",c],propertyPath:[...t.currentPath,"properties",c]});p!==void 0&&(r.properties[c]=p,d||s.push(c))}s.length&&(r.required=s);const o=bC(e,t);return o!==void 0&&(r.additionalProperties=o),r}function bC(e,t){if(e.catchall._def.typeName!=="ZodNever")return Je(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function vC(e){try{return e.isOptional()}catch{return!0}}const xC=(e,t)=>{var r;if(t.currentPath.toString()===((r=t.propertyPath)==null?void 0:r.toString()))return Je(e.innerType._def,t);const n=Je(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:{}},n]}:{}},wC=(e,t)=>{if(t.pipeStrategy==="input")return Je(e.in._def,t);if(t.pipeStrategy==="output")return Je(e.out._def,t);const n=Je(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=Je(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(s=>s!==void 0)}};function _C(e,t){return Je(e.type._def,t)}function SC(e,t){const r={type:"array",uniqueItems:!0,items:Je(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&tt(r,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&tt(r,"maxItems",e.maxSize.value,e.maxSize.message,t),r}function kC(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>Je(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Je(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>Je(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function EC(){return{not:{}}}function AC(){return{}}const TC=(e,t)=>Je(e.innerType._def,t),NC=(e,t,n)=>{switch(t){case me.ZodString:return j_(e,n);case me.ZodNumber:return mC(e,n);case me.ZodObject:return yC(e,n);case me.ZodBigInt:return JN(e,n);case me.ZodBoolean:return WN();case me.ZodDate:return D_(e,n);case me.ZodUndefined:return EC();case me.ZodNull:return hC(n);case me.ZodArray:return KN(e,n);case me.ZodUnion:case me.ZodDiscriminatedUnion:return pC(e,n);case me.ZodIntersection:return sC(e,n);case me.ZodTuple:return kC(e,n);case me.ZodRecord:return z_(e,n);case me.ZodLiteral:return lC(e,n);case me.ZodEnum:return iC(e);case me.ZodNativeEnum:return fC(e);case me.ZodNullable:return gC(e,n);case me.ZodOptional:return xC(e,n);case me.ZodMap:return cC(e,n);case me.ZodSet:return SC(e,n);case me.ZodLazy:return()=>e.getter()._def;case me.ZodPromise:return _C(e,n);case me.ZodNaN:case me.ZodNever:return dC();case me.ZodEffects:return rC(e,n);case me.ZodAny:return QN();case me.ZodUnknown:return AC();case me.ZodDefault:return nC(e,n);case me.ZodBranded:return R_(e,n);case me.ZodReadonly:return TC(e,n);case me.ZodCatch:return eC(e,n);case me.ZodPipeline:return wC(e,n);case me.ZodFunction:case me.ZodVoid:case me.ZodSymbol:return;default:return(r=>{})()}};function Je(e,t,n=!1){var c;const r=t.seen.get(e);if(t.override){const f=(c=t.override)==null?void 0:c.call(t,e,t,r,n);if(f!==GN)return f}if(r&&!n){const f=CC(r,t);if(f!==void 0)return f}const s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);const l=NC(e,e.typeName,t),o=typeof l=="function"?Je(l(),t):l;if(o&&MC(e,t,o),t.postProcess){const f=t.postProcess(o,e,t);return s.jsonSchema=o,f}return s.jsonSchema=o,o}const CC=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:OC(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,r)=>t.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{}):t.$refStrategy==="seen"?{}:void 0}},OC=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")},MC=(e,t,n)=>(e.description&&(n.description=e.description,t.markdownDescription&&(n.markdownDescription=e.description)),n),RC=(e,t)=>{const n=XN(t),r=void 0,s=t==null?void 0:t.name,l=Je(e._def,n,!1)??{},o=s===void 0?r?{...l,[n.definitionPath]:r}:l:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,s].join("/"),[n.definitionPath]:{...r,[s]:l}};return n.target==="jsonSchema7"?o.$schema="http://json-schema.org/draft-07/schema#":(n.target==="jsonSchema2019-09"||n.target==="openAi")&&(o.$schema="https://json-schema.org/draft/2019-09/schema#"),n.target==="openAi"&&("anyOf"in o||"oneOf"in o||"allOf"in o||"type"in o&&Array.isArray(o.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),o},DC=e=>({render:e.render,onlyRender:e.onlyRender,name:e.name,description:e.description||"",parameters:qN(VN(e.parameters||[])),returnDirect:e.returnDirect,callbackMessage:e.callbackMessage,allowAgent:e.allowAgent,allowGraph:e.allowGraph,async execute(t,n){var r;try{const s=await((r=e.handler)==null?void 0:r.call(e,t,n));return typeof s=="string"?[{type:"text",text:s}]:[{type:"text",text:JSON.stringify(s)}]}catch(s){return[{type:"text",text:`Error: ${s}`}]}}}),jC=e=>({name:e.name,description:e.description,parameters:e.isPureParams?e.parameters:RC(ic(e.parameters))}),fs=DC;class L_{constructor(){this.tools=new Map,this.waitingMap=new Map}bindTool(t){if(this.tools.has(t.name))throw new Error(`Tool with name ${t.name} already exists`);this.tools.set(t.name,t)}bindTools(t){t.forEach(n=>this.bindTool(n))}getAllTools(){return Array.from(this.tools.values())}getTool(t){return this.tools.get(t)}removeTool(t){return this.tools.delete(t)}clearTools(){this.tools.clear()}reset(){this.clearTools(),this.clearWaiting()}clearWaiting(){this.waitingMap.clear()}async callTool(t,n,r){var l;const s=this.getTool(t);if(!s)throw new Error(`Tool with name ${t} not found`);return await((l=s.execute)==null?void 0:l.call(s,n,r))}async toJSON(t,n=!0){return Array.from(this.tools.values()).filter(r=>n?!r.onlyRender:!0).filter(r=>!r.allowGraph||r.allowGraph.includes(t)).map(r=>jC(r))}doneWaiting(t,n){return this.waitingMap.has(t)?(this.waitingMap.get(t)(n),this.waitingMap.delete(t),!0):(console.warn(`Waiting for tool ${t} not found`),!1)}waitForDone(t){return this.waitingMap.has(t)?this.waitingMap.get(t):new Promise((r,s)=>{this.waitingMap.set(t,r)})}static waitForUIDone(t,n){return n.client.tools.waitForDone(n.message.id)}}class Lh{static isUser(t){return t.type==="human"}static isTool(t){return t.type==="tool"}static isAssistant(t){return t.type==="ai"&&!this.isToolAssistant(t)}static isToolAssistant(t){var n,r;return t.type==="ai"&&(((n=t.tool_calls)==null?void 0:n.length)||((r=t.tool_call_chunks)==null?void 0:r.length))}}class zC extends hN{constructor(t){super(t),this.currentAssistant=null,this.currentThread=null,this.streamingCallbacks=new Set,this.tools=new L_,this.stopController=null,this.subAgentsKey="task_store",this.availableAssistants=[],this.streamingMessage=[],this.graphMessages=[],this.graphState={},this.graphPosition="",this.extraParams={}}listAssistants(){return this.assistants.search({metadata:null,offset:0,limit:100})}async initAssistant(t){try{const n=await this.listAssistants();if(this.availableAssistants=n,n.length>0)if(t){if(this.currentAssistant=n.find(r=>r.graph_id===t)||null,!this.currentAssistant)throw new Error("Agent not found: "+t)}else this.currentAssistant=n[0];else throw new Error("No assistants found")}catch(n){throw console.error("Failed to initialize LangGraphClient:",n),n}}async createThread({threadId:t}={}){try{return this.currentThread=await this.threads.create({threadId:t}),this.currentThread}catch(n){throw console.error("Failed to create new thread:",n),n}}graphVisualize(){var t;return this.assistants.getGraph((t=this.currentAssistant)==null?void 0:t.assistant_id,{xray:!0})}async listThreads(){return this.threads.search({sortOrder:"desc"})}async resetThread(t,n){var r;return await this.initAssistant(t),this.currentThread=await this.threads.get(n),this.graphState=this.currentThread.values,this.graphMessages=((r=this.graphState)==null?void 0:r.messages)||[],this.emitStreamingUpdate({type:"value",data:{event:"messages/partial",data:{messages:this.graphMessages}}}),this.currentThread}async resetStream(){const t=await this.runs.list(this.currentThread.thread_id),n=t==null?void 0:t.find(r=>r.status==="running"||r.status==="pending");n&&await this.sendMessage([],{joinRunId:n.run_id})}cloneMessage(t){return JSON.parse(JSON.stringify(t))}updateStreamingMessage(t){const n=this.streamingMessage[this.streamingMessage.length-1];if(!(n!=null&&n.id)||t.id!==n.id){this.streamingMessage.push(t);return}this.streamingMessage[this.streamingMessage.length-1]=t}combineGraphMessagesWithStreamingMessages(){const t=new Map(this.streamingMessage.map(n=>[n.id,n]));return[...this.graphMessages.map(n=>{if(t.has(n.id)){const r=t.get(n.id);return t.delete(n.id),r}return n}),...t.values()]}get renderMessage(){var l;const t=new Map,n=new Set,r=[],s=this.combineGraphMessagesWithStreamingMessages();for(let o=s.length-1;o>=0;o--){const c=this.cloneMessage(s[o]);if(!c.id){r.unshift(c);continue}if(c.type==="ai"&&(c.name||(c.name=this.getGraphNodeNow().name)),Lh.isToolAssistant(c)){const f=c;t.set(c.id,f);const p=((l=f.tool_calls)!=null&&l.length?f.tool_calls:f.tool_call_chunks).filter(g=>!n.has(g.id)).map((g,m)=>{var b,x,w,_;return{type:"tool",additional_kwargs:{},tool_input:(_=(w=(x=(b=f.additional_kwargs)==null?void 0:b.tool_calls)==null?void 0:x[m])==null?void 0:w.function)==null?void 0:_.arguments,id:g.id,name:g.name,response_metadata:{},tool_call_id:g.id,content:""}});for(const g of p)t.has(g.id)||(r.unshift(g),t.set(g.id,g));r.unshift(f)}else c.type==="tool"&&c.tool_call_id&&n.add(c.tool_call_id),t.set(c.id,c),r.unshift(c)}return this.convertSubAgentMessages(this.attachInfoForMessage(this.composeToolMessages(r)))}convertSubAgentMessages(t){const n=this.graphState[this.subAgentsKey];if(!n)return t;const r=JSON.parse(JSON.stringify(n));console.log(t),t.filter(o=>{var c;return(c=o.node_name)==null?void 0:c.startsWith("subagent_")}).forEach(o=>{const c=o.node_name.replace("subagent_",""),f=r[c];f?f.messages.some(p=>p.id===o.id)||f.messages.push(o):r[c]={messages:[o]}});const s=new Set;Object.values(r).forEach(o=>{o.messages.forEach(c=>{s.add(c.id)})});const l=[];for(const o of t){if(o.type==="tool"&&o.tool_call_id){const c=r[o.tool_call_id];c&&(o.sub_agent_messages=this.attachInfoForMessage(this.composeToolMessages(c.messages)))}o.id&&s.has(o.id)||l.push(o)}return l}attachInfoForMessage(t){var r,s,l;let n=null;for(const o of t){const c=((r=o.response_metadata)==null?void 0:r.create_time)||"";if(o.unique_id=o.tool_call_id||o.id,o.spend_time=new Date(c).getTime()-new Date(((s=n==null?void 0:n.response_metadata)==null?void 0:s.create_time)||c).getTime(),!o.usage_metadata&&((l=o.response_metadata)!=null&&l.usage)){const f=o.response_metadata.usage;o.usage_metadata={...f,input_tokens:f.prompt_tokens,output_tokens:f.completion_tokens,total_tokens:f.total_tokens}}n=o}return t}composeToolMessages(t){var l,o;const n=[],r=new Map,s=new Map;for(const c of t)if(!(Lh.isToolAssistant(c)&&((l=c.tool_calls||c.tool_call_chunks)==null||l.forEach(f=>{r.set(f.id,f),s.set(f.id,c)}),!c.content))){if(Lh.isTool(c)&&!c.tool_input){const f=r.get(c.tool_call_id),d=s.get(c.tool_call_id);f&&(c.tool_input=typeof f.args!="string"?JSON.stringify(f.args):f.args,c.additional_kwargs?(c.additional_kwargs.done=!0,c.done=!0):(c.done=!0,c.additional_kwargs={done:!0})),d&&(c.usage_metadata=d.usage_metadata,c.node_name=d.name,c.name||(c.name=(o=d.tool_calls.find(p=>p.id===c.tool_call_id))==null?void 0:o.name))}n.push(c)}return n}get tokenCounter(){return this.graphMessages.reduce((t,n)=>{var r,s,l,o,c;if(n.usage_metadata)t.total_tokens+=((r=n.usage_metadata)==null?void 0:r.total_tokens)||0,t.input_tokens+=((s=n.usage_metadata)==null?void 0:s.input_tokens)||0,t.output_tokens+=((l=n.usage_metadata)==null?void 0:l.output_tokens)||0;else if((o=n.response_metadata)!=null&&o.usage){const f=(c=n.response_metadata)==null?void 0:c.usage;t.total_tokens+=f.total_tokens||0,t.input_tokens+=f.prompt_tokens||0,t.output_tokens+=f.completion_tokens||0}return t},{total_tokens:0,input_tokens:0,output_tokens:0})}onStreamingUpdate(t){return this.streamingCallbacks.add(t),()=>{this.streamingCallbacks.delete(t)}}emitStreamingUpdate(t){this.streamingCallbacks.forEach(n=>n(t))}isFELocking(t){var s;const n=t[t.length-1];if(!n)return!1;const r=this.tools.getTool(n==null?void 0:n.name);return r&&r.render&&(n==null?void 0:n.type)==="tool"&&!((s=n==null?void 0:n.additional_kwargs)!=null&&s.done)}cancelRun(){var t,n;(t=this.currentThread)!=null&&t.thread_id&&((n=this.currentRun)!=null&&n.run_id)&&this.runs.cancel(this.currentThread.thread_id,this.currentRun.run_id)}async sendMessage(t,{joinRunId:n,extraParams:r,_debug:s,command:l}={}){var g;if(!this.currentAssistant)throw new Error("Thread or Assistant not initialized");this.currentThread||(await this.createThread(),this.emitStreamingUpdate({type:"thread",data:{event:"thread/create",data:{thread:this.currentThread}}}));const o=Array.isArray(t)?t:[{type:"human",content:t}],f=await(async()=>s!=null&&s.streamResponse?s.streamResponse:n?this.runs.joinStream(this.currentThread.thread_id,n):this.runs.stream(this.currentThread.thread_id,this.currentAssistant.assistant_id,{input:{...this.graphState,...this.extraParams,...r||{},messages:o,fe_tools:await this.tools.toJSON(this.currentAssistant.graph_id)},streamMode:["messages","values"],streamSubgraphs:!0,command:l}))(),d=[];this.emitStreamingUpdate({type:"start",data:{event:"start"}});for await(const m of f)if(d.push(m),m.event==="metadata")this.currentRun=m.data;else if(m.event==="error")this.emitStreamingUpdate({type:"error",data:m});else if(m.event==="messages/partial"){for(const b of m.data)this.updateStreamingMessage(b);this.emitStreamingUpdate({type:"message",data:m});continue}else if(m.event==="values"){const b=m.data;if(b.messages){const x=!!(l!=null&&l.resume),w=b.messages.length>=this.graphMessages.length;(!x||x&&w)&&(this.graphMessages=b.messages,this.emitStreamingUpdate({type:"value",data:m})),this.graphState=m.data}continue}else m.event.startsWith("values|")&&((g=m.data)!=null&&g.messages&&this.mergeSubGraphMessagesToStreamingMessages(m.data.messages),this.graphPosition=m.event.split("|")[1]);const p=await this.runFETool();return p&&d.push(...p),this.emitStreamingUpdate({type:"done",data:{event:"done"}}),this.streamingMessage=[],d}getGraphPosition(){return this.graphPosition.split("|").map(t=>{const[n,r]=t.split(":");return{id:r,name:n}})}getGraphNodeNow(){const t=this.getGraphPosition();return t[t.length-1]}mergeSubGraphMessagesToStreamingMessages(t){const n=new Map(t.filter(r=>r.id).map(r=>[r.id,r]));this.streamingMessage.forEach(r=>{if(n.has(r.id)){const s=n.get(r.id);Object.assign(r,s),n.delete(r.id)}}),n.forEach(r=>{r.type==="tool"&&r.tool_call_id&&this.streamingMessage.push(r)})}runFETool(){var r;const t=this.streamingMessage,n=t[t.length-1];if(n&&n.type==="ai"&&(r=n.tool_calls)!=null&&r.length){const s=n.tool_calls.map(l=>{if(this.tools.getTool(l.name)){const o={...l,tool_call_id:l.id,tool_input:JSON.stringify(l.args),additional_kwargs:{}};return this.callFETool(o,l.args)}});return this.currentThread.status="interrupted",Promise.all(s)}}async callFETool(t,n){const r=this,s=await this.tools.callTool(t.name,n,{client:r,message:t});if(s)return this.resume(s)}resume(t){return this.sendMessage([],{command:{resume:t}})}doneFEToolWaiting(t,n){var s;!this.tools.doneWaiting(t,n)&&((s=this.currentThread)==null?void 0:s.status)==="interrupted"&&this.resume(n)}getCurrentThread(){return this.currentThread}getCurrentAssistant(){return this.currentAssistant}async reset(){var t;await this.initAssistant((t=this.currentAssistant)==null?void 0:t.graph_id),this.currentThread=null,this.graphState={},this.graphMessages=[],this.streamingMessage=[],this.currentRun=void 0,this.tools.clearWaiting(),this.emitStreamingUpdate({type:"value",data:{event:"messages/partial"}})}}let Un=[],di=0;const Fu=4;let an=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},lc:0,listen(r){return n.lc=t.push(r),()=>{for(let l=di+Fu;l<Un.length;)Un[l]===r?Un.splice(l,Fu):l+=Fu;let s=t.indexOf(r);~s&&(t.splice(s,1),--n.lc)}},notify(r,s){let l=!Un.length;for(let o of t)Un.push(o,n.value,r,s);if(l){for(di=0;di<Un.length;di+=Fu)Un[di](Un[di+1],Un[di+2],Un[di+3]);Un.length=0}},off(){},set(r){let s=n.value;s!==r&&(n.value=r,n.notify(s))},subscribe(r){let s=n.listen(r);return r(n.value),s},value:e};return n};function LC(e,t,n){let r=new Set(t).add(void 0);return e.listen((s,l,o)=>{r.has(o)&&n(s,l,o)})}function IC(e,t,n){var r,s,l;n===void 0&&(n={});var o=(r=n.isImmediate)!=null&&r,c=(s=n.callback)!=null&&s,f=n.maxWait,d=Date.now(),p=[];function g(){if(f!==void 0){var b=Date.now()-d;if(b+t>=f)return f-b}return t}var m=function(){var b=[].slice.call(arguments),x=this;return new Promise(function(w,_){var k=o&&l===void 0;if(l!==void 0&&clearTimeout(l),l=setTimeout(function(){if(l=void 0,d=Date.now(),!o){var S=e.apply(x,b);c&&c(S),p.forEach(function(O){return(0,O.resolve)(S)}),p=[]}},g()),k){var A=e.apply(x,b);return c&&c(A),w(A)}p.push({resolve:w,reject:_})})};return m.cancel=function(b){l!==void 0&&clearTimeout(l),p.forEach(function(x){return(0,x.reject)(b)}),p=[]},m}const BC=e=>e.toLocaleTimeString("en-US"),FC=e=>e.toLocaleString("en"),am=e=>typeof e=="string"?e:Array.isArray(e)?e.map(t=>typeof t=="string"?t:t.type==="text"?t.text:t.type==="image_url"?"[图片]":JSON.stringify(t)).join(""):JSON.stringify(e),PC=e=>{var n,r,s;const t=(s=(r=(n=e==null?void 0:e.values)==null?void 0:n.messages)==null?void 0:r[0])==null?void 0:s.content;return t&&Array.isArray(t)?t.map(l=>{if(l.type==="text")return l.text}):typeof t=="string"?t:""},UC=(e,t,n={})=>{const r=an(null),s=an([]),l=an(""),o=an(!1),c=an([]),f=an(null),d=an(n.showHistory??!1),p=an(e),g=an(null),m=an("__start__"),b=an([]),x=async()=>{const B=r.get();B&&(B.tools.clearTools(),B.tools.bindTools(b.get()))},w=an(n.showGraph??!1),_=an(null),k=async()=>{var B;w.get()&&_.set(await((B=r.get())==null?void 0:B.graphVisualize())||null)},A=IC(B=>{const q=B.renderMessage,R=q[q.length-1];m.set((R==null?void 0:R.node_name)||(R==null?void 0:R.name)||"__start__"),s.set(q)},10);async function S(){var q;const B=new zC(t);return await B.initAssistant(p.get()),p.set(B.getCurrentAssistant().graph_id),f.set(null),B.onStreamingUpdate(R=>{var $;if(g.set((($=B.getCurrentThread())==null?void 0:$.thread_id)||null),R.type==="start"&&o.set(!0),R.type==="thread"||R.type==="done")return m.set("__start__"),R.type==="done"&&o.set(!1),U();R.type==="error"&&(o.set(!1),f.set(R.data)),A(B)}),(q=n.onInit)==null||q.call(n,B),B.graphState={},r.set(B),w.get()&&k(),x(),B}const O=async(B,q)=>{var R;!l.get().trim()&&!(B!=null&&B.length)||o.get()||!r.get()||(o.set(!0),f.set(null),await((R=r.get())==null?void 0:R.sendMessage(B||l.get(),q)),l.set(""),o.set(!1))},D=()=>{var B;(B=r.get())==null||B.cancelRun()},M=B=>{const q=c.get();c.set(q.includes(B)?q.filter(R=>R!==B):[...q,B])},F=()=>{d.set(!d.get()),d.get()&&U()},L=an([]),U=async()=>{var B;if(!(!r.get()||!d.get()))try{const q=await((B=r.get())==null?void 0:B.listThreads());L.set(q||[])}catch(q){console.error("Failed to fetch threads:",q)}};return{data:{client:r,renderMessages:s,userInput:l,loading:o,inChatError:f,currentAgent:p,collapsedTools:c,showHistory:d,historyList:L,currentChatId:g,showGraph:w,graphVisualize:_,currentNodeName:m,tools:b},mutations:{refreshTools:x,setTools(B){b.set(B),x()},isFELocking(){var B;return(B=r.get())==null?void 0:B.isFELocking(s.get())},initClient:S,sendMessage:O,stopGeneration:D,toggleToolCollapse:M,toggleHistoryVisible:F,refreshHistoryList:U,addToHistory:B=>{const q=L.get();L.set([B,...q])},setUserInput(B){l.set(B)},setCurrentAgent(B){return p.set(B),S().then(()=>{d.get()&&U()})},toggleGraphVisible(){w.set(!w.get()),w.get()&&k()},refreshGraph:k,createNewChat(){var B;(B=r.get())==null||B.reset(),f.set(null),o.set(!1)},async toHistoryChat(B){var R,$,I;f.set(null),o.set(!1);const q=await(($=r.get())==null?void 0:$.resetThread((R=B.metadata)==null?void 0:R.graph_id,B.thread_id));return q&&((I=r.get())==null||I.resetStream()),q},async deleteHistoryChat(B){var q;await((q=r.get())==null?void 0:q.threads.delete(B.thread_id)),await U()},getToolUIRender:B=>{var $;const R=($=r.get().tools.getAllTools().find(I=>I.name===B))==null?void 0:$.render;return R?I=>R(new lO(I,r.get())):null}}}};class Za extends Error{constructor(t,n){super("".concat(t," at position ").concat(n)),this.position=n}}const I_=32,HC=10,B_=9,F_=13,$C=160,VC=8192,qC=8202,GC=8239,ZC=8287,YC=12288;function XC(e){return/^[0-9A-Fa-f]$/.test(e)}function Gi(e){return e>="0"&&e<="9"}function QC(e){return e>=" "}function Pu(e){return`,:[]/{}()
|
|
54
|
+
+`.includes(e)}function sx(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="_"||e==="$"}function lx(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="_"||e==="$"||e>="0"&&e<="9"}const ox=/^(http|https|ftp|mailto|file|data|irc):\/\/$/,ux=/^[A-Za-z0-9-._~:/?#@!$&'()*+;=]$/;function cx(e){return`,[]/{}
|
|
55
|
+
+`.includes(e)}function fx(e){return ac(e)||KC.test(e)}const KC=/^[[{\w-]$/;function JC(e){return e===`
|
|
56
|
+
`||e==="\r"||e===" "||e==="\b"||e==="\f"}function Xi(e,t){const n=e.charCodeAt(t);return n===I_||n===HC||n===B_||n===F_}function WC(e,t){const n=e.charCodeAt(t);return n===I_||n===B_||n===F_}function eO(e,t){const n=e.charCodeAt(t);return n===$C||n>=VC&&n<=qC||n===GC||n===ZC||n===YC}function ac(e){return P_(e)||Sg(e)}function P_(e){return e==='"'||e==="“"||e==="”"}function dx(e){return e==='"'}function Sg(e){return e==="'"||e==="‘"||e==="’"||e==="`"||e==="´"}function hx(e){return e==="'"}function Nl(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const r=e.lastIndexOf(t);return r!==-1?e.substring(0,r)+(n?"":e.substring(r+1)):e}function Hn(e,t){let n=e.length;if(!Xi(e,n-1))return e+t;for(;Xi(e,n-1);)n--;return e.substring(0,n)+t+e.substring(n)}function tO(e,t,n){return e.substring(0,t)+e.substring(t+n)}function nO(e){return/[,\n][ \t\r]*$/.test(e)}const rO={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},iO={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
57
|
+
`,r:"\r",t:" "};function aO(e){let t=0,n="";d(),l()||q(),d();const s=p(",");for(s&&o(),fx(e[t])&&nO(n)?(s||(n=Hn(n,",")),_()):s&&(n=Nl(n,","));e[t]==="}"||e[t]==="]";)t++,o();if(t>=e.length)return n;B();function l(){o();const P=x()||w()||k()||S()||O()||M(!1)||F();return o(),P}function o(){let P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const Y=t;let X=c(P);do X=f(),X&&(X=c(P));while(X);return t>Y}function c(P){const Y=P?Xi:WC;let X="";for(;;)if(Y(e,t))X+=e[t],t++;else if(eO(e,t))X+=" ",t++;else break;return X.length>0?(n+=X,!0):!1}function f(){if(e[t]==="/"&&e[t+1]==="*"){for(;t<e.length&&!sO(e,t);)t++;return t+=2,!0}if(e[t]==="/"&&e[t+1]==="/"){for(;t<e.length&&e[t]!==`
|
|
58
|
+
`;)t++;return!0}return!1}function d(){if(e.slice(t,t+3)==="```"){if(t+=3,sx(e[t]))for(;t<e.length&&lx(e[t]);)t++;return o(),!0}return!1}function p(P){return e[t]===P?(n+=e[t],t++,!0):!1}function g(P){return e[t]===P?(t++,!0):!1}function m(){return g("\\")}function b(){return o(),e[t]==="."&&e[t+1]==="."&&e[t+2]==="."?(t+=3,o(),g(","),!0):!1}function x(){if(e[t]==="{"){n+="{",t++,o(),g(",")&&o();let P=!0;for(;t<e.length&&e[t]!=="}";){let Y;if(P?(Y=!0,P=!1):(Y=p(","),Y||(n=Hn(n,",")),o()),b(),!(k()||M(!0))){e[t]==="}"||e[t]==="{"||e[t]==="]"||e[t]==="["||e[t]===void 0?n=Nl(n,","):R();break}o();const E=p(":"),G=t>=e.length;E||(fx(e[t])||G?n=Hn(n,":"):$()),l()||(E||G?n+="null":$())}return e[t]==="}"?(n+="}",t++):n=Hn(n,"}"),!0}return!1}function w(){if(e[t]==="["){n+="[",t++,o(),g(",")&&o();let P=!0;for(;t<e.length&&e[t]!=="]";)if(P?P=!1:p(",")||(n=Hn(n,",")),b(),!l()){n=Nl(n,",");break}return e[t]==="]"?(n+="]",t++):n=Hn(n,"]"),!0}return!1}function _(){let P=!0,Y=!0;for(;Y;)P?P=!1:p(",")||(n=Hn(n,",")),Y=l();Y||(n=Nl(n,",")),n=`[
|
|
59
59
|
`.concat(n,`
|
|
60
|
-
]`)}function k(){let P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,X=e[t]==="\\";if(X&&(t++,X=!0),ac(e[t])){const E=fx(e[t])?fx:dx(e[t])?dx:Sg(e[t])?Sg:F_,G=t,te=n.length;let T='"';for(t++;;){if(t>=e.length){const V=L(t-1);return!P&&Pu(e.charAt(V))?(t=G,n=n.substring(0,te),k(!0)):(T=Hn(T,'"'),n+=T,!0)}else{if(t===Y)return T=Hn(T,'"'),n+=T,!0;if(E(e[t])){const V=t,K=T.length;if(T+='"',t++,n+=T,o(!1),P||t>=e.length||Pu(e[t])||ac(e[t])||Gi(e[t]))return A(),!0;const J=L(V-1),le=e.charAt(J);if(le===",")return t=G,n=n.substring(0,te),k(!1,J);if(Pu(le))return t=G,n=n.substring(0,te),k(!0);n=n.substring(0,te),t=V+1,T="".concat(T.substring(0,K),"\\").concat(T.substring(K))}else if(P&&ux(e[t])){if(e[t-1]===":"&&lx.test(e.substring(G+1,t+2)))for(;t<e.length&&ox.test(e[t]);)T+=e[t],t++;return T=Hn(T,'"'),n+=T,A(),!0}else if(e[t]==="\\"){const V=e.charAt(t+1);if(iO[V]!==void 0)T+=e.slice(t,t+2),t+=2;else if(V==="u"){let J=2;for(;J<6&&XN(e[t+J]);)J++;J===6?(T+=e.slice(t,t+6),t+=6):t+J>=e.length?t=e.length:I()}else T+=V,t+=2}else{const V=e.charAt(t);V==='"'&&e[t-1]!=="\\"?(T+="\\".concat(V),t++):JN(V)?(T+=rO[V],t++):(QN(V)||H(V),T+=V,t++)}}X&&m()}}return!1}function A(){let P=!1;for(o();e[t]==="+";){P=!0,t++,o(),n=Cl(n,'"',!0);const Y=n.length;k()?n=tO(n,Y,1):n=Hn(n,'"')}return P}function S(){const P=t;if(e[t]==="-"){if(t++,U())return j(P),!0;if(!Gi(e[t]))return t=P,!1}for(;Gi(e[t]);)t++;if(e[t]==="."){if(t++,U())return j(P),!0;if(!Gi(e[t]))return t=P,!1;for(;Gi(e[t]);)t++}if(e[t]==="e"||e[t]==="E"){if(t++,(e[t]==="-"||e[t]==="+")&&t++,U())return j(P),!0;if(!Gi(e[t]))return t=P,!1;for(;Gi(e[t]);)t++}if(!U())return t=P,!1;if(t>P){const Y=e.slice(P,t),X=/^0\d/.test(Y);return n+=X?'"'.concat(Y,'"'):Y,!0}return!1}function O(){return D("true","true")||D("false","false")||D("null","null")||D("True","true")||D("False","false")||D("None","null")}function D(P,Y){return e.slice(t,t+P.length)===P?(n+=Y,t+=P.length,!0):!1}function M(P){const Y=t;if(ax(e[t])){for(;t<e.length&&sx(e[t]);)t++;let X=t;for(;Xi(e,X);)X++;if(e[X]==="(")return t=X+1,l(),e[t]===")"&&(t++,e[t]===";"&&t++),!0}for(;t<e.length&&!ux(e[t])&&!ac(e[t])&&(!P||e[t]!==":");)t++;if(e[t-1]===":"&&lx.test(e.substring(Y,t+2)))for(;t<e.length&&ox.test(e[t]);)t++;if(t>Y){for(;Xi(e,t-1)&&t>0;)t--;const X=e.slice(Y,t);return n+=X==="undefined"?"null":JSON.stringify(X),e[t]==='"'&&t++,!0}}function F(){if(e[t]==="/"){const P=t;for(t++;t<e.length&&(e[t]!=="/"||e[t-1]==="\\");)t++;return t++,n+='"'.concat(e.substring(P,t),'"'),!0}}function L(P){let Y=P;for(;Y>0&&Xi(e,Y);)Y--;return Y}function U(){return t>=e.length||Pu(e[t])||Xi(e,t)}function j(P){n+="".concat(e.slice(P,t),"0")}function H(P){throw new Za("Invalid character ".concat(JSON.stringify(P)),t)}function B(){throw new Za("Unexpected character ".concat(JSON.stringify(e[t])),t)}function q(){throw new Za("Unexpected end of json string",e.length)}function R(){throw new Za("Object key expected",t)}function $(){throw new Za("Colon expected",t)}function I(){const P=e.slice(t,t+6);throw new Za('Invalid unicode character "'.concat(P,'"'),t)}}function sO(e,t){return e[t]==="*"&&e[t+1]==="/"}class lO{constructor(t,n){this.message=t,this.client=n}get state(){var t,n;return this.message.type==="tool"&&((n=(t=this.message)==null?void 0:t.additional_kwargs)!=null&&n.done)?"done":this.message.tool_input?"loading":"idle"}get input(){try{return JSON.parse(this.message.tool_input)}catch{return null}}get output(){return am(this.message.content)}getJSONOutput(){return JSON.parse(this.output)}getJSONOutputSafe(){try{return JSON.parse(this.output)}catch{return null}}getInputRepaired(){try{return JSON.parse(aO(this.message.tool_input||""))}catch{return{}}}response(t){this.client.doneFEToolWaiting(this.message.id,JSON.stringify(t))}}const oO=(e,t)=>({...Object.fromEntries(Object.entries(e.data).map(([r,s])=>[r,t(s)])),...e.mutations});function uO(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const cO=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fO=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dO={};function hx(e,t){return(dO.jsx?fO:cO).test(e)}const hO=/[ \t\n\f\r]/g;function pO(e){return typeof e=="object"?e.type==="text"?px(e.value):!1:px(e)}function px(e){return e.replace(hO,"")===""}class lo{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}lo.prototype.normal={};lo.prototype.property={};lo.prototype.space=void 0;function P_(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new lo(n,r,t)}function kg(e){return e.toLowerCase()}class on{constructor(t,n){this.attribute=n,this.property=t}}on.prototype.attribute="";on.prototype.booleanish=!1;on.prototype.boolean=!1;on.prototype.commaOrSpaceSeparated=!1;on.prototype.commaSeparated=!1;on.prototype.defined=!1;on.prototype.mustUseProperty=!1;on.prototype.number=!1;on.prototype.overloadedBoolean=!1;on.prototype.property="";on.prototype.spaceSeparated=!1;on.prototype.space=void 0;let gO=0;const Le=la(),Et=la(),U_=la(),pe=la(),ct=la(),rs=la(),bn=la();function la(){return 2**++gO}const Eg=Object.freeze(Object.defineProperty({__proto__:null,boolean:Le,booleanish:Et,commaOrSpaceSeparated:bn,commaSeparated:rs,number:pe,overloadedBoolean:U_,spaceSeparated:ct},Symbol.toStringTag,{value:"Module"})),Ih=Object.keys(Eg);class sm extends on{constructor(t,n,r,s){let l=-1;if(super(t,n),gx(this,"space",s),typeof r=="number")for(;++l<Ih.length;){const o=Ih[l];gx(this,Ih[l],(r&Eg[o])===Eg[o])}}}sm.prototype.defined=!0;function gx(e,t,n){n&&(e[t]=n)}function xs(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const l=new sm(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[kg(r)]=r,n[kg(l.attribute)]=r}return new lo(t,n,e.space)}const H_=xs({properties:{ariaActiveDescendant:null,ariaAtomic:Et,ariaAutoComplete:null,ariaBusy:Et,ariaChecked:Et,ariaColCount:pe,ariaColIndex:pe,ariaColSpan:pe,ariaControls:ct,ariaCurrent:null,ariaDescribedBy:ct,ariaDetails:null,ariaDisabled:Et,ariaDropEffect:ct,ariaErrorMessage:null,ariaExpanded:Et,ariaFlowTo:ct,ariaGrabbed:Et,ariaHasPopup:null,ariaHidden:Et,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ct,ariaLevel:pe,ariaLive:null,ariaModal:Et,ariaMultiLine:Et,ariaMultiSelectable:Et,ariaOrientation:null,ariaOwns:ct,ariaPlaceholder:null,ariaPosInSet:pe,ariaPressed:Et,ariaReadOnly:Et,ariaRelevant:null,ariaRequired:Et,ariaRoleDescription:ct,ariaRowCount:pe,ariaRowIndex:pe,ariaRowSpan:pe,ariaSelected:Et,ariaSetSize:pe,ariaSort:null,ariaValueMax:pe,ariaValueMin:pe,ariaValueNow:pe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function $_(e,t){return t in e?e[t]:t}function V_(e,t){return $_(e,t.toLowerCase())}const mO=xs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:rs,acceptCharset:ct,accessKey:ct,action:null,allow:null,allowFullScreen:Le,allowPaymentRequest:Le,allowUserMedia:Le,alt:null,as:null,async:Le,autoCapitalize:null,autoComplete:ct,autoFocus:Le,autoPlay:Le,blocking:ct,capture:null,charSet:null,checked:Le,cite:null,className:ct,cols:pe,colSpan:null,content:null,contentEditable:Et,controls:Le,controlsList:ct,coords:pe|rs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Le,defer:Le,dir:null,dirName:null,disabled:Le,download:U_,draggable:Et,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Le,formTarget:null,headers:ct,height:pe,hidden:Le,high:pe,href:null,hrefLang:null,htmlFor:ct,httpEquiv:ct,id:null,imageSizes:null,imageSrcSet:null,inert:Le,inputMode:null,integrity:null,is:null,isMap:Le,itemId:null,itemProp:ct,itemRef:ct,itemScope:Le,itemType:ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Le,low:pe,manifest:null,max:null,maxLength:pe,media:null,method:null,min:null,minLength:pe,multiple:Le,muted:Le,name:null,nonce:null,noModule:Le,noValidate:Le,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Le,optimum:pe,pattern:null,ping:ct,placeholder:null,playsInline:Le,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Le,referrerPolicy:null,rel:ct,required:Le,reversed:Le,rows:pe,rowSpan:pe,sandbox:ct,scope:null,scoped:Le,seamless:Le,selected:Le,shadowRootClonable:Le,shadowRootDelegatesFocus:Le,shadowRootMode:null,shape:null,size:pe,sizes:null,slot:null,span:pe,spellCheck:Et,src:null,srcDoc:null,srcLang:null,srcSet:null,start:pe,step:null,style:null,tabIndex:pe,target:null,title:null,translate:null,type:null,typeMustMatch:Le,useMap:null,value:Et,width:pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ct,axis:null,background:null,bgColor:null,border:pe,borderColor:null,bottomMargin:pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Le,declare:Le,event:null,face:null,frame:null,frameBorder:null,hSpace:pe,leftMargin:pe,link:null,longDesc:null,lowSrc:null,marginHeight:pe,marginWidth:pe,noResize:Le,noHref:Le,noShade:Le,noWrap:Le,object:null,profile:null,prompt:null,rev:null,rightMargin:pe,rules:null,scheme:null,scrolling:Et,standby:null,summary:null,text:null,topMargin:pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Le,disableRemotePlayback:Le,prefix:null,property:null,results:pe,security:null,unselectable:null},space:"html",transform:V_}),yO=xs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:bn,accentHeight:pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:pe,amplitude:pe,arabicForm:null,ascent:pe,attributeName:null,attributeType:null,azimuth:pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:pe,by:null,calcMode:null,capHeight:pe,className:ct,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:pe,diffuseConstant:pe,direction:null,display:null,dur:null,divisor:pe,dominantBaseline:null,download:Le,dx:null,dy:null,edgeMode:null,editable:null,elevation:pe,enableBackground:null,end:null,event:null,exponent:pe,externalResourcesRequired:null,fill:null,fillOpacity:pe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:rs,g2:rs,glyphName:rs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:pe,horizOriginX:pe,horizOriginY:pe,id:null,ideographic:pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:pe,k:pe,k1:pe,k2:pe,k3:pe,k4:pe,kernelMatrix:bn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:pe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:pe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:pe,overlineThickness:pe,paintOrder:null,panose1:null,path:null,pathLength:pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:pe,pointsAtY:pe,pointsAtZ:pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bn,rev:bn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bn,requiredFeatures:bn,requiredFonts:bn,requiredFormats:bn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:pe,specularExponent:pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:pe,strikethroughThickness:pe,string:null,stroke:null,strokeDashArray:bn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:pe,strokeOpacity:pe,strokeWidth:null,style:null,surfaceScale:pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bn,tabIndex:pe,tableValues:null,target:null,targetX:pe,targetY:pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:pe,underlineThickness:pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:pe,values:null,vAlphabetic:pe,vMathematical:pe,vectorEffect:null,vHanging:pe,vIdeographic:pe,version:null,vertAdvY:pe,vertOriginX:pe,vertOriginY:pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:$_}),q_=xs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),G_=xs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:V_}),Z_=xs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),bO={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},vO=/[A-Z]/g,mx=/-[a-z]/g,xO=/^data[-\w.:]+$/i;function wO(e,t){const n=kg(t);let r=t,s=on;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&xO.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(mx,SO);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!mx.test(l)){let o=l.replace(vO,_O);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=sm}return new s(r,t)}function _O(e){return"-"+e.toLowerCase()}function SO(e){return e.charAt(1).toUpperCase()}const kO=P_([H_,mO,q_,G_,Z_],"html"),lm=P_([H_,yO,q_,G_,Z_],"svg");function EO(e){return e.join(" ").trim()}var Ya={},Bh,yx;function AO(){if(yx)return Bh;yx=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
|
|
61
|
-
`,d="/",p="*",g="",m="comment",b="declaration";Bh=function(w,_){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];_=_||{};var k=1,A=1;function S(q){var R=q.match(t);R&&(k+=R.length);var $=q.lastIndexOf(f);A=~$?q.length-$:A+q.length}function O(){var q={line:k,column:A};return function(R){return R.position=new D(q),L(),R}}function D(q){this.start=q,this.end={line:k,column:A},this.source=_.source}D.prototype.content=w;function M(q){var R=new Error(_.source+":"+k+":"+A+": "+q);if(R.reason=q,R.filename=_.source,R.line=k,R.column=A,R.source=w,!_.silent)throw R}function F(q){var R=q.exec(w);if(R){var $=R[0];return S($),w=w.slice($.length),R}}function L(){F(n)}function U(q){var R;for(q=q||[];R=j();)R!==!1&&q.push(R);return q}function j(){var q=O();if(!(d!=w.charAt(0)||p!=w.charAt(1))){for(var R=2;g!=w.charAt(R)&&(p!=w.charAt(R)||d!=w.charAt(R+1));)++R;if(R+=2,g===w.charAt(R-1))return M("End of comment missing");var $=w.slice(2,R-2);return A+=2,S($),w=w.slice(R),A+=2,q({type:m,comment:$})}}function H(){var q=O(),R=F(r);if(R){if(j(),!F(s))return M("property missing ':'");var $=F(l),I=q({type:b,property:x(R[0].replace(e,g)),value:$?x($[0].replace(e,g)):g});return F(o),I}}function B(){var q=[];U(q);for(var R;R=H();)R!==!1&&(q.push(R),U(q));return q}return L(),B()};function x(w){return w?w.replace(c,g):g}return Bh}var bx;function TO(){if(bx)return Ya;bx=1;var e=Ya&&Ya.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.default=n;var t=e(AO());function n(r,s){var l=null;if(!r||typeof r!="string")return l;var o=(0,t.default)(r),c=typeof s=="function";return o.forEach(function(f){if(f.type==="declaration"){var d=f.property,p=f.value;c?s(d,p,f):p&&(l=l||{},l[d]=p)}}),l}return Ya}var Nl={},vx;function CO(){if(vx)return Nl;vx=1,Object.defineProperty(Nl,"__esModule",{value:!0}),Nl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,l=function(d){return!d||n.test(d)||e.test(d)},o=function(d,p){return p.toUpperCase()},c=function(d,p){return"".concat(p,"-")},f=function(d,p){return p===void 0&&(p={}),l(d)?d:(d=d.toLowerCase(),p.reactCompat?d=d.replace(s,c):d=d.replace(r,c),d.replace(t,o))};return Nl.camelCase=f,Nl}var Ol,xx;function NO(){if(xx)return Ol;xx=1;var e=Ol&&Ol.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(TO()),n=CO();function r(s,l){var o={};return!s||typeof s!="string"||(0,t.default)(s,function(c,f){c&&f&&(o[(0,n.camelCase)(c,l)]=f)}),o}return r.default=r,Ol=r,Ol}var OO=NO();const MO=ki(OO),Y_=X_("end"),om=X_("start");function X_(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function RO(e){const t=om(e),n=Y_(e);if(t&&n)return{start:t,end:n}}function Fl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?wx(e.position):"start"in e||"end"in e?wx(e):"line"in e||"column"in e?Ag(e):""}function Ag(e){return _x(e&&e.line)+":"+_x(e&&e.column)}function wx(e){return Ag(e&&e.start)+"-"+Ag(e&&e.end)}function _x(e){return e&&typeof e=="number"?e:1}class qt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",l={},o=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?s=t:!l.cause&&t&&(o=!0,s=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?l.ruleId=r:(l.source=r.slice(0,f),l.ruleId=r.slice(f+1))}if(!l.place&&l.ancestors&&l.ancestors){const f=l.ancestors[l.ancestors.length-1];f&&(l.place=f.position)}const c=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file,this.message=s,this.line=c?c.line:void 0,this.name=Fl(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual,this.expected,this.note,this.url}}qt.prototype.file="";qt.prototype.name="";qt.prototype.reason="";qt.prototype.message="";qt.prototype.stack="";qt.prototype.column=void 0;qt.prototype.line=void 0;qt.prototype.ancestors=void 0;qt.prototype.cause=void 0;qt.prototype.fatal=void 0;qt.prototype.place=void 0;qt.prototype.ruleId=void 0;qt.prototype.source=void 0;const um={}.hasOwnProperty,DO=new Map,jO=/[A-Z]/g,zO=new Set(["table","tbody","thead","tfoot","tr"]),LO=new Set(["td","th"]),Q_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function IO(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=qO(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=VO(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?lm:kO,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=K_(s,e,void 0);return l&&typeof l!="string"?l:s.create(e,s.Fragment,{children:l||void 0},void 0)}function K_(e,t,n){if(t.type==="element")return BO(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return FO(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return UO(e,t,n);if(t.type==="mdxjsEsm")return PO(e,t);if(t.type==="root")return HO(e,t,n);if(t.type==="text")return $O(e,t)}function BO(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=lm,e.schema=s),e.ancestors.push(t);const l=W_(e,t.tagName,!1),o=GO(e,t);let c=fm(e,t);return zO.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!pO(f):!0})),J_(e,o,l,t),cm(o,c),e.ancestors.pop(),e.schema=r,e.create(t,l,o,n)}function FO(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Yl(e,t.position)}function PO(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Yl(e,t.position)}function UO(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=lm,e.schema=s),e.ancestors.push(t);const l=t.name===null?e.Fragment:W_(e,t.name,!0),o=ZO(e,t),c=fm(e,t);return J_(e,o,l,t),cm(o,c),e.ancestors.pop(),e.schema=r,e.create(t,l,o,n)}function HO(e,t,n){const r={};return cm(r,fm(e,t)),e.create(t,e.Fragment,r,n)}function $O(e,t){return t.value}function J_(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function cm(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function VO(e,t,n){return r;function r(s,l,o,c){const d=Array.isArray(o.children)?n:t;return c?d(l,o,c):d(l,o)}}function qO(e,t){return n;function n(r,s,l,o){const c=Array.isArray(l.children),f=om(r);return t(s,l,o,c,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function GO(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&um.call(t.properties,s)){const l=YO(e,s,t.properties[s]);if(l){const[o,c]=l;e.tableCellAlignToStyle&&o==="align"&&typeof c=="string"&&LO.has(t.tagName)?r=c:n[o]=c}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function ZO(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const o=l.expression;o.type;const c=o.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Yl(e,t.position);else{const s=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,l=e.evaluater.evaluateExpression(c.expression)}else Yl(e,t.position);else l=r.value===null?!0:r.value;n[s]=l}return n}function fm(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:DO;for(;++r<t.children.length;){const l=t.children[r];let o;if(e.passKeys){const f=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(f){const d=s.get(f)||0;o=f+"-"+d,s.set(f,d+1)}}const c=K_(e,l,o);c!==void 0&&n.push(c)}return n}function YO(e,t,n){const r=wO(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?uO(n):EO(n)),r.property==="style"){let s=typeof n=="object"?n:XO(e,String(n));return e.stylePropertyNameCase==="css"&&(s=QO(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?bO[r.property]||r.property:r.attribute,n]}}function XO(e,t){try{return MO(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new qt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=Q_+"#cannot-parse-style-attribute",s}}function W_(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let l=-1,o;for(;++l<s.length;){const c=hx(s[l])?{type:"Identifier",name:s[l]}:{type:"Literal",value:s[l]};o=o?{type:"MemberExpression",object:o,property:c,computed:!!(l&&c.type==="Literal"),optional:!1}:c}r=o}else r=hx(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return um.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);Yl(e)}function Yl(e,t){const n=new qt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Q_+"#cannot-handle-mdx-estrees-without-createevaluater",n}function QO(e){const t={};let n;for(n in e)um.call(e,n)&&(t[KO(n)]=e[n]);return t}function KO(e){let t=e.replace(jO,JO);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function JO(e){return"-"+e.toLowerCase()}const Fh={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},WO={};function dm(e,t){const n=WO,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return eS(e,r,s)}function eS(e,t,n){if(eM(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Sx(e.children,t,n)}return Array.isArray(e)?Sx(e,t,n):""}function Sx(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=eS(e[s],t,n);return r.join("")}function eM(e){return!!(e&&typeof e=="object")}const kx=document.createElement("i");function hm(e){const t="&"+e+";";kx.innerHTML=t;const n=kx.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function xn(e,t,n,r){const s=e.length;let l=0,o;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);l<r.length;)o=r.slice(l,l+1e4),o.unshift(t,0),e.splice(...o),l+=1e4,t+=1e4}function Mn(e,t){return e.length>0?(xn(e,e.length,0,t),e):t}const Ex={}.hasOwnProperty;function tS(e){const t={};let n=-1;for(;++n<e.length;)tM(t,e[n]);return t}function tM(e,t){let n;for(n in t){const s=(Ex.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let o;if(l)for(o in l){Ex.call(s,o)||(s[o]=[]);const c=l[o];nM(s[o],Array.isArray(c)?c:c?[c]:[])}}}function nM(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);xn(e,0,0,r)}function nS(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Gn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Qt=Ei(/[A-Za-z]/),Vt=Ei(/[\dA-Za-z]/),rM=Ei(/[#-'*+\--9=?A-Z^-~]/);function bc(e){return e!==null&&(e<32||e===127)}const Tg=Ei(/\d/),iM=Ei(/[\dA-Fa-f]/),aM=Ei(/[!-/:-@[-`{-~]/);function Ce(e){return e!==null&&e<-2}function st(e){return e!==null&&(e<0||e===32)}function $e(e){return e===-2||e===-1||e===32}const Pc=Ei(new RegExp("\\p{P}|\\p{S}","u")),ia=Ei(/\s/);function Ei(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ws(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const l=e.charCodeAt(n);let o="";if(l===37&&Vt(e.charCodeAt(n+1))&&Vt(e.charCodeAt(n+2)))s=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){const c=e.charCodeAt(n+1);l<56320&&c>56319&&c<57344?(o=String.fromCharCode(l,c),s=1):o="�"}else o=String.fromCharCode(l);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+s+1,o=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function qe(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(f){return $e(f)?(e.enter(n),c(f)):t(f)}function c(f){return $e(f)&&l++<s?(e.consume(f),c):(e.exit(n),t(f))}}const sM={tokenize:lM};function lM(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),qe(e,t,"linePrefix")}function s(c){return e.enter("paragraph"),l(c)}function l(c){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,o(c)}function o(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return Ce(c)?(e.consume(c),e.exit("chunkText"),l):(e.consume(c),o)}}const oM={tokenize:uM},Ax={tokenize:cM};function uM(e){const t=this,n=[];let r=0,s,l,o;return c;function c(S){if(r<n.length){const O=n[r];return t.containerState=O[1],e.attempt(O[0].continuation,f,d)(S)}return d(S)}function f(S){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&A();const O=t.events.length;let D=O,M;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){M=t.events[D][1].end;break}k(r);let F=O;for(;F<t.events.length;)t.events[F][1].end={...M},F++;return xn(t.events,D+1,0,t.events.slice(O)),t.events.length=F,d(S)}return c(S)}function d(S){if(r===n.length){if(!s)return m(S);if(s.currentConstruct&&s.currentConstruct.concrete)return x(S);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ax,p,g)(S)}function p(S){return s&&A(),k(r),m(S)}function g(S){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,x(S)}function m(S){return t.containerState={},e.attempt(Ax,b,x)(S)}function b(S){return r++,n.push([t.currentConstruct,t.containerState]),m(S)}function x(S){if(S===null){s&&A(),k(0),e.consume(S);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:l}),w(S)}function w(S){if(S===null){_(e.exit("chunkFlow"),!0),k(0),e.consume(S);return}return Ce(S)?(e.consume(S),_(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(S),w)}function _(S,O){const D=t.sliceStream(S);if(O&&D.push(null),S.previous=l,l&&(l.next=S),l=S,s.defineSkip(S.start),s.write(D),t.parser.lazy[S.start.line]){let M=s.events.length;for(;M--;)if(s.events[M][1].start.offset<o&&(!s.events[M][1].end||s.events[M][1].end.offset>o))return;const F=t.events.length;let L=F,U,j;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(U){j=t.events[L][1].end;break}U=!0}for(k(r),M=F;M<t.events.length;)t.events[M][1].end={...j},M++;xn(t.events,L+1,0,t.events.slice(F)),t.events.length=M}}function k(S){let O=n.length;for(;O-- >S;){const D=n[O];t.containerState=D[1],D[0].exit.call(t,e)}n.length=S}function A(){s.write([null]),l=void 0,s=void 0,t.containerState._closeFlow=void 0}}function cM(e,t,n){return qe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ds(e){if(e===null||st(e)||ia(e))return 1;if(Pc(e))return 2}function Uc(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const l=e[s].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const Cg={name:"attention",resolveAll:fM,tokenize:dM};function fM(e,t){let n=-1,r,s,l,o,c,f,d,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[r][1].end},m={...e[n][1].start};Tx(g,-f),Tx(m,f),o={type:f>1?"strongSequence":"emphasisSequence",start:g,end:{...e[r][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},l={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:f>1?"strong":"emphasis",start:{...o.start},end:{...c.end}},e[r][1].end={...o.start},e[n][1].start={...c.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=Mn(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=Mn(d,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",l,t]]),d=Mn(d,Uc(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=Mn(d,[["exit",l,t],["enter",c,t],["exit",c,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,d=Mn(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,xn(e,r-1,n-r+3,d),n=r+d.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function dM(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=ds(r);let l;return o;function o(f){return l=f,e.enter("attentionSequence"),c(f)}function c(f){if(f===l)return e.consume(f),c;const d=e.exit("attentionSequence"),p=ds(f),g=!p||p===2&&s||n.includes(f),m=!s||s===2&&p||n.includes(r);return d._open=!!(l===42?g:g&&(s||!m)),d._close=!!(l===42?m:m&&(p||!g)),t(f)}}function Tx(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const hM={name:"autolink",tokenize:pM};function pM(e,t,n){let r=0;return s;function s(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(b){return Qt(b)?(e.consume(b),o):b===64?n(b):d(b)}function o(b){return b===43||b===45||b===46||Vt(b)?(r=1,c(b)):d(b)}function c(b){return b===58?(e.consume(b),r=0,f):(b===43||b===45||b===46||Vt(b))&&r++<32?(e.consume(b),c):(r=0,d(b))}function f(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||bc(b)?n(b):(e.consume(b),f)}function d(b){return b===64?(e.consume(b),p):rM(b)?(e.consume(b),d):n(b)}function p(b){return Vt(b)?g(b):n(b)}function g(b){return b===46?(e.consume(b),r=0,p):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):m(b)}function m(b){if((b===45||Vt(b))&&r++<63){const x=b===45?m:g;return e.consume(b),x}return n(b)}}const oo={partial:!0,tokenize:gM};function gM(e,t,n){return r;function r(l){return $e(l)?qe(e,s,"linePrefix")(l):s(l)}function s(l){return l===null||Ce(l)?t(l):n(l)}}const rS={continuation:{tokenize:yM},exit:bM,name:"blockQuote",tokenize:mM};function mM(e,t,n){const r=this;return s;function s(o){if(o===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),l}return n(o)}function l(o){return $e(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function yM(e,t,n){const r=this;return s;function s(o){return $e(o)?qe(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(rS,t,n)(o)}}function bM(e){e.exit("blockQuote")}const iS={name:"characterEscape",tokenize:vM};function vM(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),s}function s(l){return aM(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const aS={name:"characterReference",tokenize:xM};function xM(e,t,n){const r=this;let s=0,l,o;return c;function c(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),f}function f(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),l=31,o=Vt,p(g))}function d(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=iM,p):(e.enter("characterReferenceValue"),l=7,o=Tg,p(g))}function p(g){if(g===59&&s){const m=e.exit("characterReferenceValue");return o===Vt&&!hm(r.sliceSerialize(m))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(g)&&s++<l?(e.consume(g),p):n(g)}}const Cx={partial:!0,tokenize:_M},Nx={concrete:!0,name:"codeFenced",tokenize:wM};function wM(e,t,n){const r=this,s={partial:!0,tokenize:D};let l=0,o=0,c;return f;function f(M){return d(M)}function d(M){const F=r.events[r.events.length-1];return l=F&&F[1].type==="linePrefix"?F[2].sliceSerialize(F[1],!0).length:0,c=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(M)}function p(M){return M===c?(o++,e.consume(M),p):o<3?n(M):(e.exit("codeFencedFenceSequence"),$e(M)?qe(e,g,"whitespace")(M):g(M))}function g(M){return M===null||Ce(M)?(e.exit("codeFencedFence"),r.interrupt?t(M):e.check(Cx,w,O)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(M))}function m(M){return M===null||Ce(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(M)):$e(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),qe(e,b,"whitespace")(M)):M===96&&M===c?n(M):(e.consume(M),m)}function b(M){return M===null||Ce(M)?g(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(M))}function x(M){return M===null||Ce(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(M)):M===96&&M===c?n(M):(e.consume(M),x)}function w(M){return e.attempt(s,O,_)(M)}function _(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),k}function k(M){return l>0&&$e(M)?qe(e,A,"linePrefix",l+1)(M):A(M)}function A(M){return M===null||Ce(M)?e.check(Cx,w,O)(M):(e.enter("codeFlowValue"),S(M))}function S(M){return M===null||Ce(M)?(e.exit("codeFlowValue"),A(M)):(e.consume(M),S)}function O(M){return e.exit("codeFenced"),t(M)}function D(M,F,L){let U=0;return j;function j($){return M.enter("lineEnding"),M.consume($),M.exit("lineEnding"),H}function H($){return M.enter("codeFencedFence"),$e($)?qe(M,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):B($)}function B($){return $===c?(M.enter("codeFencedFenceSequence"),q($)):L($)}function q($){return $===c?(U++,M.consume($),q):U>=o?(M.exit("codeFencedFenceSequence"),$e($)?qe(M,R,"whitespace")($):R($)):L($)}function R($){return $===null||Ce($)?(M.exit("codeFencedFence"),F($)):L($)}}}function _M(e,t,n){const r=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Ph={name:"codeIndented",tokenize:kM},SM={partial:!0,tokenize:EM};function kM(e,t,n){const r=this;return s;function s(d){return e.enter("codeIndented"),qe(e,l,"linePrefix",5)(d)}function l(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?o(d):n(d)}function o(d){return d===null?f(d):Ce(d)?e.attempt(SM,o,f)(d):(e.enter("codeFlowValue"),c(d))}function c(d){return d===null||Ce(d)?(e.exit("codeFlowValue"),o(d)):(e.consume(d),c)}function f(d){return e.exit("codeIndented"),t(d)}}function EM(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):Ce(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):qe(e,l,"linePrefix",5)(o)}function l(o){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):Ce(o)?s(o):n(o)}}const AM={name:"codeText",previous:CM,resolve:TM,tokenize:NM};function TM(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function CM(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function NM(e,t,n){let r=0,s,l;return o;function o(g){return e.enter("codeText"),e.enter("codeTextSequence"),c(g)}function c(g){return g===96?(e.consume(g),r++,c):(e.exit("codeTextSequence"),f(g))}function f(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),f):g===96?(l=e.enter("codeTextSequence"),s=0,p(g)):Ce(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),f):(e.enter("codeTextData"),d(g))}function d(g){return g===null||g===32||g===96||Ce(g)?(e.exit("codeTextData"),f(g)):(e.consume(g),d)}function p(g){return g===96?(e.consume(g),s++,p):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(l.type="codeTextData",d(g))}}class OM{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Ml(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ml(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ml(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ml(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ml(this.left,n.reverse())}}}function Ml(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function sS(e){const t={};let n=-1,r,s,l,o,c,f,d;const p=new OM(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,l=0,l<f.length&&f[l][1].type==="lineEndingBlank"&&(l+=2),l<f.length&&f[l][1].type==="content"))for(;++l<f.length&&f[l][1].type!=="content";)f[l][1].type==="chunkText"&&(f[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,MM(p,n)),n=t[n],d=!0);else if(r[1]._container){for(l=n,s=void 0;l--;)if(o=p.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(p.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=l);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(r[1].end={...p.get(s)[1].start},c=p.slice(s,n),c.unshift(r),p.splice(s,n-s+1,c))}}return xn(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!d}function MM(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const l=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const c=o.events,f=[],d={};let p,g,m=-1,b=n,x=0,w=0;const _=[w];for(;b;){for(;e.get(++s)[1]!==b;);l.push(s),b._tokenizer||(p=r.sliceStream(b),b.next||p.push(null),g&&o.defineSkip(b.start),b._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(p),b._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),g=b,b=b.next}for(b=n;++m<c.length;)c[m][0]==="exit"&&c[m-1][0]==="enter"&&c[m][1].type===c[m-1][1].type&&c[m][1].start.line!==c[m][1].end.line&&(w=m+1,_.push(w),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(o.events=[],b?(b._tokenizer=void 0,b.previous=void 0):_.pop(),m=_.length;m--;){const k=c.slice(_[m],_[m+1]),A=l.pop();f.push([A,A+k.length-1]),e.splice(A,2,k)}for(f.reverse(),m=-1;++m<f.length;)d[x+f[m][0]]=x+f[m][1],x+=f[m][1]-f[m][0]-1;return d}const RM={resolve:jM,tokenize:zM},DM={partial:!0,tokenize:LM};function jM(e){return sS(e),e}function zM(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(c)}function s(c){return c===null?l(c):Ce(c)?e.check(DM,o,l)(c):(e.consume(c),s)}function l(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function o(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function LM(e,t,n){const r=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),qe(e,l,"linePrefix")}function l(o){if(o===null||Ce(o))return n(o);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function lS(e,t,n,r,s,l,o,c,f){const d=f||Number.POSITIVE_INFINITY;let p=0;return g;function g(k){return k===60?(e.enter(r),e.enter(s),e.enter(l),e.consume(k),e.exit(l),m):k===null||k===32||k===41||bc(k)?n(k):(e.enter(r),e.enter(o),e.enter(c),e.enter("chunkString",{contentType:"string"}),w(k))}function m(k){return k===62?(e.enter(l),e.consume(k),e.exit(l),e.exit(s),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),b(k))}function b(k){return k===62?(e.exit("chunkString"),e.exit(c),m(k)):k===null||k===60||Ce(k)?n(k):(e.consume(k),k===92?x:b)}function x(k){return k===60||k===62||k===92?(e.consume(k),b):b(k)}function w(k){return!p&&(k===null||k===41||st(k))?(e.exit("chunkString"),e.exit(c),e.exit(o),e.exit(r),t(k)):p<d&&k===40?(e.consume(k),p++,w):k===41?(e.consume(k),p--,w):k===null||k===32||k===40||bc(k)?n(k):(e.consume(k),k===92?_:w)}function _(k){return k===40||k===41||k===92?(e.consume(k),w):w(k)}}function oS(e,t,n,r,s,l){const o=this;let c=0,f;return d;function d(b){return e.enter(r),e.enter(s),e.consume(b),e.exit(s),e.enter(l),p}function p(b){return c>999||b===null||b===91||b===93&&!f||b===94&&!c&&"_hiddenFootnoteSupport"in o.parser.constructs?n(b):b===93?(e.exit(l),e.enter(s),e.consume(b),e.exit(s),e.exit(r),t):Ce(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||b===91||b===93||Ce(b)||c++>999?(e.exit("chunkString"),p(b)):(e.consume(b),f||(f=!$e(b)),b===92?m:g)}function m(b){return b===91||b===92||b===93?(e.consume(b),c++,g):g(b)}}function uS(e,t,n,r,s,l){let o;return c;function c(m){return m===34||m===39||m===40?(e.enter(r),e.enter(s),e.consume(m),e.exit(s),o=m===40?41:m,f):n(m)}function f(m){return m===o?(e.enter(s),e.consume(m),e.exit(s),e.exit(r),t):(e.enter(l),d(m))}function d(m){return m===o?(e.exit(l),f(o)):m===null?n(m):Ce(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),qe(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===o||m===null||Ce(m)?(e.exit("chunkString"),d(m)):(e.consume(m),m===92?g:p)}function g(m){return m===o||m===92?(e.consume(m),p):p(m)}}function Pl(e,t){let n;return r;function r(s){return Ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):$e(s)?qe(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const IM={name:"definition",tokenize:FM},BM={partial:!0,tokenize:PM};function FM(e,t,n){const r=this;let s;return l;function l(b){return e.enter("definition"),o(b)}function o(b){return oS.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function c(b){return s=Gn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),f):n(b)}function f(b){return st(b)?Pl(e,d)(b):d(b)}function d(b){return lS(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function p(b){return e.attempt(BM,g,g)(b)}function g(b){return $e(b)?qe(e,m,"whitespace")(b):m(b)}function m(b){return b===null||Ce(b)?(e.exit("definition"),r.parser.defined.push(s),t(b)):n(b)}}function PM(e,t,n){return r;function r(c){return st(c)?Pl(e,s)(c):n(c)}function s(c){return uS(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function l(c){return $e(c)?qe(e,o,"whitespace")(c):o(c)}function o(c){return c===null||Ce(c)?t(c):n(c)}}const UM={name:"hardBreakEscape",tokenize:HM};function HM(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),s}function s(l){return Ce(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const $M={name:"headingAtx",resolve:VM,tokenize:qM};function VM(e,t){let n=e.length-2,r=3,s,l;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},xn(e,r,n-r+1,[["enter",s,t],["enter",l,t],["exit",l,t],["exit",s,t]])),e}function qM(e,t,n){let r=0;return s;function s(p){return e.enter("atxHeading"),l(p)}function l(p){return e.enter("atxHeadingSequence"),o(p)}function o(p){return p===35&&r++<6?(e.consume(p),o):p===null||st(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),f(p)):p===null||Ce(p)?(e.exit("atxHeading"),t(p)):$e(p)?qe(e,c,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function f(p){return p===35?(e.consume(p),f):(e.exit("atxHeadingSequence"),c(p))}function d(p){return p===null||p===35||st(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),d)}}const GM=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Ox=["pre","script","style","textarea"],ZM={concrete:!0,name:"htmlFlow",resolveTo:QM,tokenize:KM},YM={partial:!0,tokenize:WM},XM={partial:!0,tokenize:JM};function QM(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function KM(e,t,n){const r=this;let s,l,o,c,f;return d;function d(T){return p(T)}function p(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),g}function g(T){return T===33?(e.consume(T),m):T===47?(e.consume(T),l=!0,w):T===63?(e.consume(T),s=3,r.interrupt?t:E):Qt(T)?(e.consume(T),o=String.fromCharCode(T),_):n(T)}function m(T){return T===45?(e.consume(T),s=2,b):T===91?(e.consume(T),s=5,c=0,x):Qt(T)?(e.consume(T),s=4,r.interrupt?t:E):n(T)}function b(T){return T===45?(e.consume(T),r.interrupt?t:E):n(T)}function x(T){const V="CDATA[";return T===V.charCodeAt(c++)?(e.consume(T),c===V.length?r.interrupt?t:B:x):n(T)}function w(T){return Qt(T)?(e.consume(T),o=String.fromCharCode(T),_):n(T)}function _(T){if(T===null||T===47||T===62||st(T)){const V=T===47,K=o.toLowerCase();return!V&&!l&&Ox.includes(K)?(s=1,r.interrupt?t(T):B(T)):GM.includes(o.toLowerCase())?(s=6,V?(e.consume(T),k):r.interrupt?t(T):B(T)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(T):l?A(T):S(T))}return T===45||Vt(T)?(e.consume(T),o+=String.fromCharCode(T),_):n(T)}function k(T){return T===62?(e.consume(T),r.interrupt?t:B):n(T)}function A(T){return $e(T)?(e.consume(T),A):j(T)}function S(T){return T===47?(e.consume(T),j):T===58||T===95||Qt(T)?(e.consume(T),O):$e(T)?(e.consume(T),S):j(T)}function O(T){return T===45||T===46||T===58||T===95||Vt(T)?(e.consume(T),O):D(T)}function D(T){return T===61?(e.consume(T),M):$e(T)?(e.consume(T),D):S(T)}function M(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),f=T,F):$e(T)?(e.consume(T),M):L(T)}function F(T){return T===f?(e.consume(T),f=null,U):T===null||Ce(T)?n(T):(e.consume(T),F)}function L(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||st(T)?D(T):(e.consume(T),L)}function U(T){return T===47||T===62||$e(T)?S(T):n(T)}function j(T){return T===62?(e.consume(T),H):n(T)}function H(T){return T===null||Ce(T)?B(T):$e(T)?(e.consume(T),H):n(T)}function B(T){return T===45&&s===2?(e.consume(T),I):T===60&&s===1?(e.consume(T),P):T===62&&s===4?(e.consume(T),G):T===63&&s===3?(e.consume(T),E):T===93&&s===5?(e.consume(T),X):Ce(T)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(YM,te,q)(T)):T===null||Ce(T)?(e.exit("htmlFlowData"),q(T)):(e.consume(T),B)}function q(T){return e.check(XM,R,te)(T)}function R(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),$}function $(T){return T===null||Ce(T)?q(T):(e.enter("htmlFlowData"),B(T))}function I(T){return T===45?(e.consume(T),E):B(T)}function P(T){return T===47?(e.consume(T),o="",Y):B(T)}function Y(T){if(T===62){const V=o.toLowerCase();return Ox.includes(V)?(e.consume(T),G):B(T)}return Qt(T)&&o.length<8?(e.consume(T),o+=String.fromCharCode(T),Y):B(T)}function X(T){return T===93?(e.consume(T),E):B(T)}function E(T){return T===62?(e.consume(T),G):T===45&&s===2?(e.consume(T),E):B(T)}function G(T){return T===null||Ce(T)?(e.exit("htmlFlowData"),te(T)):(e.consume(T),G)}function te(T){return e.exit("htmlFlow"),t(T)}}function JM(e,t,n){const r=this;return s;function s(o){return Ce(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):n(o)}function l(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function WM(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(oo,t,n)}}const e4={name:"htmlText",tokenize:t4};function t4(e,t,n){const r=this;let s,l,o;return c;function c(E){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(E),f}function f(E){return E===33?(e.consume(E),d):E===47?(e.consume(E),D):E===63?(e.consume(E),S):Qt(E)?(e.consume(E),L):n(E)}function d(E){return E===45?(e.consume(E),p):E===91?(e.consume(E),l=0,x):Qt(E)?(e.consume(E),A):n(E)}function p(E){return E===45?(e.consume(E),b):n(E)}function g(E){return E===null?n(E):E===45?(e.consume(E),m):Ce(E)?(o=g,P(E)):(e.consume(E),g)}function m(E){return E===45?(e.consume(E),b):g(E)}function b(E){return E===62?I(E):E===45?m(E):g(E)}function x(E){const G="CDATA[";return E===G.charCodeAt(l++)?(e.consume(E),l===G.length?w:x):n(E)}function w(E){return E===null?n(E):E===93?(e.consume(E),_):Ce(E)?(o=w,P(E)):(e.consume(E),w)}function _(E){return E===93?(e.consume(E),k):w(E)}function k(E){return E===62?I(E):E===93?(e.consume(E),k):w(E)}function A(E){return E===null||E===62?I(E):Ce(E)?(o=A,P(E)):(e.consume(E),A)}function S(E){return E===null?n(E):E===63?(e.consume(E),O):Ce(E)?(o=S,P(E)):(e.consume(E),S)}function O(E){return E===62?I(E):S(E)}function D(E){return Qt(E)?(e.consume(E),M):n(E)}function M(E){return E===45||Vt(E)?(e.consume(E),M):F(E)}function F(E){return Ce(E)?(o=F,P(E)):$e(E)?(e.consume(E),F):I(E)}function L(E){return E===45||Vt(E)?(e.consume(E),L):E===47||E===62||st(E)?U(E):n(E)}function U(E){return E===47?(e.consume(E),I):E===58||E===95||Qt(E)?(e.consume(E),j):Ce(E)?(o=U,P(E)):$e(E)?(e.consume(E),U):I(E)}function j(E){return E===45||E===46||E===58||E===95||Vt(E)?(e.consume(E),j):H(E)}function H(E){return E===61?(e.consume(E),B):Ce(E)?(o=H,P(E)):$e(E)?(e.consume(E),H):U(E)}function B(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),s=E,q):Ce(E)?(o=B,P(E)):$e(E)?(e.consume(E),B):(e.consume(E),R)}function q(E){return E===s?(e.consume(E),s=void 0,$):E===null?n(E):Ce(E)?(o=q,P(E)):(e.consume(E),q)}function R(E){return E===null||E===34||E===39||E===60||E===61||E===96?n(E):E===47||E===62||st(E)?U(E):(e.consume(E),R)}function $(E){return E===47||E===62||st(E)?U(E):n(E)}function I(E){return E===62?(e.consume(E),e.exit("htmlTextData"),e.exit("htmlText"),t):n(E)}function P(E){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),Y}function Y(E){return $e(E)?qe(e,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):X(E)}function X(E){return e.enter("htmlTextData"),o(E)}}const pm={name:"labelEnd",resolveAll:a4,resolveTo:s4,tokenize:l4},n4={tokenize:o4},r4={tokenize:u4},i4={tokenize:c4};function a4(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&xn(e,0,e.length,n),e}function s4(e,t){let n=e.length,r=0,s,l,o,c;for(;n--;)if(s=e[n][1],l){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(l=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(o=n);const f={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},p={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[o-2][1].start}};return c=[["enter",f,t],["enter",d,t]],c=Mn(c,e.slice(l+1,l+r+3)),c=Mn(c,[["enter",p,t]]),c=Mn(c,Uc(t.parser.constructs.insideSpan.null,e.slice(l+r+4,o-3),t)),c=Mn(c,[["exit",p,t],e[o-2],e[o-1],["exit",d,t]]),c=Mn(c,e.slice(o+1)),c=Mn(c,[["exit",f,t]]),xn(e,l,e.length,c),e}function l4(e,t,n){const r=this;let s=r.events.length,l,o;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){l=r.events[s][1];break}return c;function c(m){return l?l._inactive?g(m):(o=r.parser.defined.includes(Gn(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),f):n(m)}function f(m){return m===40?e.attempt(n4,p,o?p:g)(m):m===91?e.attempt(r4,p,o?d:g)(m):o?p(m):g(m)}function d(m){return e.attempt(i4,p,g)(m)}function p(m){return t(m)}function g(m){return l._balanced=!0,n(m)}}function o4(e,t,n){return r;function r(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),s}function s(g){return st(g)?Pl(e,l)(g):l(g)}function l(g){return g===41?p(g):lS(e,o,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function o(g){return st(g)?Pl(e,f)(g):p(g)}function c(g){return n(g)}function f(g){return g===34||g===39||g===40?uS(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):p(g)}function d(g){return st(g)?Pl(e,p)(g):p(g)}function p(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function u4(e,t,n){const r=this;return s;function s(c){return oS.call(r,e,l,o,"reference","referenceMarker","referenceString")(c)}function l(c){return r.parser.defined.includes(Gn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function o(c){return n(c)}}function c4(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),s}function s(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const f4={name:"labelStartImage",resolveAll:pm.resolveAll,tokenize:d4};function d4(e,t,n){const r=this;return s;function s(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),l}function l(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),o):n(c)}function o(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const h4={name:"labelStartLink",resolveAll:pm.resolveAll,tokenize:p4};function p4(e,t,n){const r=this;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Uh={name:"lineEnding",tokenize:g4};function g4(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),qe(e,t,"linePrefix")}}const sc={name:"thematicBreak",tokenize:m4};function m4(e,t,n){let r=0,s;return l;function l(d){return e.enter("thematicBreak"),o(d)}function o(d){return s=d,c(d)}function c(d){return d===s?(e.enter("thematicBreakSequence"),f(d)):r>=3&&(d===null||Ce(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===s?(e.consume(d),r++,f):(e.exit("thematicBreakSequence"),$e(d)?qe(e,c,"whitespace")(d):c(d))}}const sn={continuation:{tokenize:x4},exit:_4,name:"list",tokenize:v4},y4={partial:!0,tokenize:S4},b4={partial:!0,tokenize:w4};function v4(e,t,n){const r=this,s=r.events[r.events.length-1];let l=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return c;function c(b){const x=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:Tg(b)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(sc,n,d)(b):d(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(b)}return n(b)}function f(b){return Tg(b)&&++o<10?(e.consume(b),f):(!r.interrupt||o<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),d(b)):n(b)}function d(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(oo,r.interrupt?n:p,e.attempt(y4,m,g))}function p(b){return r.containerState.initialBlankLine=!0,l++,m(b)}function g(b){return $e(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),m):n(b)}function m(b){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function x4(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(oo,s,l);function s(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,qe(e,t,"listItemIndent",r.containerState.size+1)(c)}function l(c){return r.containerState.furtherBlankLines||!$e(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(b4,t,o)(c))}function o(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,qe(e,e.attempt(sn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function w4(e,t,n){const r=this;return qe(e,s,"listItemIndent",r.containerState.size+1);function s(l){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(l):n(l)}}function _4(e){e.exit(this.containerState.type)}function S4(e,t,n){const r=this;return qe(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(l){const o=r.events[r.events.length-1];return!$e(l)&&o&&o[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const Mx={name:"setextUnderline",resolveTo:k4,tokenize:E4};function k4(e,t){let n=e.length,r,s,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",l?(e.splice(s,0,["enter",o,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function E4(e,t,n){const r=this;let s;return l;function l(d){let p=r.events.length,g;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){g=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||g)?(e.enter("setextHeadingLine"),s=d,o(d)):n(d)}function o(d){return e.enter("setextHeadingLineSequence"),c(d)}function c(d){return d===s?(e.consume(d),c):(e.exit("setextHeadingLineSequence"),$e(d)?qe(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||Ce(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const A4={tokenize:T4};function T4(e){const t=this,n=e.attempt(oo,r,e.attempt(this.parser.constructs.flowInitial,s,qe(e,e.attempt(this.parser.constructs.flow,s,e.attempt(RM,s)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const C4={resolveAll:fS()},N4=cS("string"),O4=cS("text");function cS(e){return{resolveAll:fS(e==="text"?M4:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],l=n.attempt(s,o,c);return o;function o(p){return d(p)?l(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),f}function f(p){return d(p)?(n.exit("data"),l(p)):(n.consume(p),f)}function d(p){if(p===null)return!0;const g=s[p];let m=-1;if(g)for(;++m<g.length;){const b=g[m];if(!b.previous||b.previous.call(r,r.previous))return!0}return!1}}}function fS(e){return t;function t(n,r){let s=-1,l;for(;++s<=n.length;)l===void 0?n[s]&&n[s][1].type==="data"&&(l=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==l+2&&(n[l][1].end=n[s-1][1].end,n.splice(l+2,s-l-2),s=l+2),l=void 0);return e?e(n,r):n}}function M4(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let l=s.length,o=-1,c=0,f;for(;l--;){const d=s[l];if(typeof d=="string"){for(o=d.length;d.charCodeAt(o-1)===32;)c++,o--;if(o)break;o=-1}else if(d===-2)f=!0,c++;else if(d!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const d={type:n===e.length||f||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:r.start._bufferIndex+o,_index:r.start._index+l,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const R4={42:sn,43:sn,45:sn,48:sn,49:sn,50:sn,51:sn,52:sn,53:sn,54:sn,55:sn,56:sn,57:sn,62:rS},D4={91:IM},j4={[-2]:Ph,[-1]:Ph,32:Ph},z4={35:$M,42:sc,45:[Mx,sc],60:ZM,61:Mx,95:sc,96:Nx,126:Nx},L4={38:aS,92:iS},I4={[-5]:Uh,[-4]:Uh,[-3]:Uh,33:f4,38:aS,42:Cg,60:[hM,e4],91:h4,92:[UM,iS],93:pm,95:Cg,96:AM},B4={null:[Cg,C4]},F4={null:[42,95]},P4={null:[]},U4=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:F4,contentInitial:D4,disable:P4,document:R4,flow:z4,flowInitial:j4,insideSpan:B4,string:L4,text:I4},Symbol.toStringTag,{value:"Module"}));function H4(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},l=[];let o=[],c=[];const f={attempt:F(D),check:F(M),consume:A,enter:S,exit:O,interrupt:F(M,{interrupt:!0})},d={code:null,containerState:{},defineSkip:w,events:[],now:x,parser:e,previous:null,sliceSerialize:m,sliceStream:b,write:g};let p=t.tokenize.call(d,f);return t.resolveAll&&l.push(t),d;function g(H){return o=Mn(o,H),_(),o[o.length-1]!==null?[]:(L(t,0),d.events=Uc(l,d.events,d),d.events)}function m(H,B){return V4(b(H),B)}function b(H){return $4(o,H)}function x(){const{_bufferIndex:H,_index:B,line:q,column:R,offset:$}=r;return{_bufferIndex:H,_index:B,line:q,column:R,offset:$}}function w(H){s[H.line]=H.column,j()}function _(){let H;for(;r._index<o.length;){const B=o[r._index];if(typeof B=="string")for(H=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===H&&r._bufferIndex<B.length;)k(B.charCodeAt(r._bufferIndex));else k(B)}}function k(H){p=p(H)}function A(H){Ce(H)?(r.line++,r.column=1,r.offset+=H===-3?2:1,j()):H!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=H}function S(H,B){const q=B||{};return q.type=H,q.start=x(),d.events.push(["enter",q,d]),c.push(q),q}function O(H){const B=c.pop();return B.end=x(),d.events.push(["exit",B,d]),B}function D(H,B){L(H,B.from)}function M(H,B){B.restore()}function F(H,B){return q;function q(R,$,I){let P,Y,X,E;return Array.isArray(R)?te(R):"tokenize"in R?te([R]):G(R);function G(J){return le;function le(fe){const ye=fe!==null&&J[fe],Ae=fe!==null&&J.null,Se=[...Array.isArray(ye)?ye:ye?[ye]:[],...Array.isArray(Ae)?Ae:Ae?[Ae]:[]];return te(Se)(fe)}}function te(J){return P=J,Y=0,J.length===0?I:T(J[Y])}function T(J){return le;function le(fe){return E=U(),X=J,J.partial||(d.currentConstruct=J),J.name&&d.parser.constructs.disable.null.includes(J.name)?K():J.tokenize.call(B?Object.assign(Object.create(d),B):d,f,V,K)(fe)}}function V(J){return H(X,E),$}function K(J){return E.restore(),++Y<P.length?T(P[Y]):I}}}function L(H,B){H.resolveAll&&!l.includes(H)&&l.push(H),H.resolve&&xn(d.events,B,d.events.length-B,H.resolve(d.events.slice(B),d)),H.resolveTo&&(d.events=H.resolveTo(d.events,d))}function U(){const H=x(),B=d.previous,q=d.currentConstruct,R=d.events.length,$=Array.from(c);return{from:R,restore:I};function I(){r=H,d.previous=B,d.currentConstruct=q,d.events.length=R,c=$,j()}}function j(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function $4(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,l=t.end._bufferIndex;let o;if(n===s)o=[e[n].slice(r,l)];else{if(o=e.slice(n,s),r>-1){const c=o[0];typeof c=="string"?o[0]=c.slice(r):o.shift()}l>0&&o.push(e[s].slice(0,l))}return o}function V4(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const l=e[n];let o;if(typeof l=="string")o=l;else switch(l){case-5:{o="\r";break}case-4:{o=`
|
|
60
|
+
]`)}function k(){let P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,X=e[t]==="\\";if(X&&(t++,X=!0),ac(e[t])){const E=dx(e[t])?dx:hx(e[t])?hx:Sg(e[t])?Sg:P_,G=t,te=n.length;let T='"';for(t++;;){if(t>=e.length){const V=L(t-1);return!P&&Pu(e.charAt(V))?(t=G,n=n.substring(0,te),k(!0)):(T=Hn(T,'"'),n+=T,!0)}else{if(t===Y)return T=Hn(T,'"'),n+=T,!0;if(E(e[t])){const V=t,K=T.length;if(T+='"',t++,n+=T,o(!1),P||t>=e.length||Pu(e[t])||ac(e[t])||Gi(e[t]))return A(),!0;const J=L(V-1),le=e.charAt(J);if(le===",")return t=G,n=n.substring(0,te),k(!1,J);if(Pu(le))return t=G,n=n.substring(0,te),k(!0);n=n.substring(0,te),t=V+1,T="".concat(T.substring(0,K),"\\").concat(T.substring(K))}else if(P&&cx(e[t])){if(e[t-1]===":"&&ox.test(e.substring(G+1,t+2)))for(;t<e.length&&ux.test(e[t]);)T+=e[t],t++;return T=Hn(T,'"'),n+=T,A(),!0}else if(e[t]==="\\"){const V=e.charAt(t+1);if(iO[V]!==void 0)T+=e.slice(t,t+2),t+=2;else if(V==="u"){let J=2;for(;J<6&&XC(e[t+J]);)J++;J===6?(T+=e.slice(t,t+6),t+=6):t+J>=e.length?t=e.length:I()}else T+=V,t+=2}else{const V=e.charAt(t);V==='"'&&e[t-1]!=="\\"?(T+="\\".concat(V),t++):JC(V)?(T+=rO[V],t++):(QC(V)||H(V),T+=V,t++)}}X&&m()}}return!1}function A(){let P=!1;for(o();e[t]==="+";){P=!0,t++,o(),n=Nl(n,'"',!0);const Y=n.length;k()?n=tO(n,Y,1):n=Hn(n,'"')}return P}function S(){const P=t;if(e[t]==="-"){if(t++,U())return j(P),!0;if(!Gi(e[t]))return t=P,!1}for(;Gi(e[t]);)t++;if(e[t]==="."){if(t++,U())return j(P),!0;if(!Gi(e[t]))return t=P,!1;for(;Gi(e[t]);)t++}if(e[t]==="e"||e[t]==="E"){if(t++,(e[t]==="-"||e[t]==="+")&&t++,U())return j(P),!0;if(!Gi(e[t]))return t=P,!1;for(;Gi(e[t]);)t++}if(!U())return t=P,!1;if(t>P){const Y=e.slice(P,t),X=/^0\d/.test(Y);return n+=X?'"'.concat(Y,'"'):Y,!0}return!1}function O(){return D("true","true")||D("false","false")||D("null","null")||D("True","true")||D("False","false")||D("None","null")}function D(P,Y){return e.slice(t,t+P.length)===P?(n+=Y,t+=P.length,!0):!1}function M(P){const Y=t;if(sx(e[t])){for(;t<e.length&&lx(e[t]);)t++;let X=t;for(;Xi(e,X);)X++;if(e[X]==="(")return t=X+1,l(),e[t]===")"&&(t++,e[t]===";"&&t++),!0}for(;t<e.length&&!cx(e[t])&&!ac(e[t])&&(!P||e[t]!==":");)t++;if(e[t-1]===":"&&ox.test(e.substring(Y,t+2)))for(;t<e.length&&ux.test(e[t]);)t++;if(t>Y){for(;Xi(e,t-1)&&t>0;)t--;const X=e.slice(Y,t);return n+=X==="undefined"?"null":JSON.stringify(X),e[t]==='"'&&t++,!0}}function F(){if(e[t]==="/"){const P=t;for(t++;t<e.length&&(e[t]!=="/"||e[t-1]==="\\");)t++;return t++,n+='"'.concat(e.substring(P,t),'"'),!0}}function L(P){let Y=P;for(;Y>0&&Xi(e,Y);)Y--;return Y}function U(){return t>=e.length||Pu(e[t])||Xi(e,t)}function j(P){n+="".concat(e.slice(P,t),"0")}function H(P){throw new Za("Invalid character ".concat(JSON.stringify(P)),t)}function B(){throw new Za("Unexpected character ".concat(JSON.stringify(e[t])),t)}function q(){throw new Za("Unexpected end of json string",e.length)}function R(){throw new Za("Object key expected",t)}function $(){throw new Za("Colon expected",t)}function I(){const P=e.slice(t,t+6);throw new Za('Invalid unicode character "'.concat(P,'"'),t)}}function sO(e,t){return e[t]==="*"&&e[t+1]==="/"}class lO{constructor(t,n){this.message=t,this.client=n}get state(){var t,n;return this.message.type==="tool"&&((n=(t=this.message)==null?void 0:t.additional_kwargs)!=null&&n.done)?"done":this.message.tool_input?"loading":"idle"}get input(){try{return JSON.parse(this.message.tool_input)}catch{return null}}get output(){return am(this.message.content)}getJSONOutput(){return JSON.parse(this.output)}getJSONOutputSafe(){try{return JSON.parse(this.output)}catch{return null}}getInputRepaired(){try{return JSON.parse(aO(this.message.tool_input||""))}catch{return{}}}response(t){this.client.doneFEToolWaiting(this.message.id,JSON.stringify(t))}}const oO=(e,t)=>({...Object.fromEntries(Object.entries(e.data).map(([r,s])=>[r,t(s)])),...e.mutations});function uO(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const cO=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fO=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dO={};function px(e,t){return(dO.jsx?fO:cO).test(e)}const hO=/[ \t\n\f\r]/g;function pO(e){return typeof e=="object"?e.type==="text"?gx(e.value):!1:gx(e)}function gx(e){return e.replace(hO,"")===""}class lo{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}lo.prototype.normal={};lo.prototype.property={};lo.prototype.space=void 0;function U_(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new lo(n,r,t)}function kg(e){return e.toLowerCase()}class on{constructor(t,n){this.attribute=n,this.property=t}}on.prototype.attribute="";on.prototype.booleanish=!1;on.prototype.boolean=!1;on.prototype.commaOrSpaceSeparated=!1;on.prototype.commaSeparated=!1;on.prototype.defined=!1;on.prototype.mustUseProperty=!1;on.prototype.number=!1;on.prototype.overloadedBoolean=!1;on.prototype.property="";on.prototype.spaceSeparated=!1;on.prototype.space=void 0;let gO=0;const Le=la(),Et=la(),H_=la(),pe=la(),ct=la(),rs=la(),bn=la();function la(){return 2**++gO}const Eg=Object.freeze(Object.defineProperty({__proto__:null,boolean:Le,booleanish:Et,commaOrSpaceSeparated:bn,commaSeparated:rs,number:pe,overloadedBoolean:H_,spaceSeparated:ct},Symbol.toStringTag,{value:"Module"})),Ih=Object.keys(Eg);class sm extends on{constructor(t,n,r,s){let l=-1;if(super(t,n),mx(this,"space",s),typeof r=="number")for(;++l<Ih.length;){const o=Ih[l];mx(this,Ih[l],(r&Eg[o])===Eg[o])}}}sm.prototype.defined=!0;function mx(e,t,n){n&&(e[t]=n)}function xs(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const l=new sm(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[kg(r)]=r,n[kg(l.attribute)]=r}return new lo(t,n,e.space)}const $_=xs({properties:{ariaActiveDescendant:null,ariaAtomic:Et,ariaAutoComplete:null,ariaBusy:Et,ariaChecked:Et,ariaColCount:pe,ariaColIndex:pe,ariaColSpan:pe,ariaControls:ct,ariaCurrent:null,ariaDescribedBy:ct,ariaDetails:null,ariaDisabled:Et,ariaDropEffect:ct,ariaErrorMessage:null,ariaExpanded:Et,ariaFlowTo:ct,ariaGrabbed:Et,ariaHasPopup:null,ariaHidden:Et,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ct,ariaLevel:pe,ariaLive:null,ariaModal:Et,ariaMultiLine:Et,ariaMultiSelectable:Et,ariaOrientation:null,ariaOwns:ct,ariaPlaceholder:null,ariaPosInSet:pe,ariaPressed:Et,ariaReadOnly:Et,ariaRelevant:null,ariaRequired:Et,ariaRoleDescription:ct,ariaRowCount:pe,ariaRowIndex:pe,ariaRowSpan:pe,ariaSelected:Et,ariaSetSize:pe,ariaSort:null,ariaValueMax:pe,ariaValueMin:pe,ariaValueNow:pe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function V_(e,t){return t in e?e[t]:t}function q_(e,t){return V_(e,t.toLowerCase())}const mO=xs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:rs,acceptCharset:ct,accessKey:ct,action:null,allow:null,allowFullScreen:Le,allowPaymentRequest:Le,allowUserMedia:Le,alt:null,as:null,async:Le,autoCapitalize:null,autoComplete:ct,autoFocus:Le,autoPlay:Le,blocking:ct,capture:null,charSet:null,checked:Le,cite:null,className:ct,cols:pe,colSpan:null,content:null,contentEditable:Et,controls:Le,controlsList:ct,coords:pe|rs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Le,defer:Le,dir:null,dirName:null,disabled:Le,download:H_,draggable:Et,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Le,formTarget:null,headers:ct,height:pe,hidden:Le,high:pe,href:null,hrefLang:null,htmlFor:ct,httpEquiv:ct,id:null,imageSizes:null,imageSrcSet:null,inert:Le,inputMode:null,integrity:null,is:null,isMap:Le,itemId:null,itemProp:ct,itemRef:ct,itemScope:Le,itemType:ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Le,low:pe,manifest:null,max:null,maxLength:pe,media:null,method:null,min:null,minLength:pe,multiple:Le,muted:Le,name:null,nonce:null,noModule:Le,noValidate:Le,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Le,optimum:pe,pattern:null,ping:ct,placeholder:null,playsInline:Le,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Le,referrerPolicy:null,rel:ct,required:Le,reversed:Le,rows:pe,rowSpan:pe,sandbox:ct,scope:null,scoped:Le,seamless:Le,selected:Le,shadowRootClonable:Le,shadowRootDelegatesFocus:Le,shadowRootMode:null,shape:null,size:pe,sizes:null,slot:null,span:pe,spellCheck:Et,src:null,srcDoc:null,srcLang:null,srcSet:null,start:pe,step:null,style:null,tabIndex:pe,target:null,title:null,translate:null,type:null,typeMustMatch:Le,useMap:null,value:Et,width:pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ct,axis:null,background:null,bgColor:null,border:pe,borderColor:null,bottomMargin:pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Le,declare:Le,event:null,face:null,frame:null,frameBorder:null,hSpace:pe,leftMargin:pe,link:null,longDesc:null,lowSrc:null,marginHeight:pe,marginWidth:pe,noResize:Le,noHref:Le,noShade:Le,noWrap:Le,object:null,profile:null,prompt:null,rev:null,rightMargin:pe,rules:null,scheme:null,scrolling:Et,standby:null,summary:null,text:null,topMargin:pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Le,disableRemotePlayback:Le,prefix:null,property:null,results:pe,security:null,unselectable:null},space:"html",transform:q_}),yO=xs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:bn,accentHeight:pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:pe,amplitude:pe,arabicForm:null,ascent:pe,attributeName:null,attributeType:null,azimuth:pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:pe,by:null,calcMode:null,capHeight:pe,className:ct,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:pe,diffuseConstant:pe,direction:null,display:null,dur:null,divisor:pe,dominantBaseline:null,download:Le,dx:null,dy:null,edgeMode:null,editable:null,elevation:pe,enableBackground:null,end:null,event:null,exponent:pe,externalResourcesRequired:null,fill:null,fillOpacity:pe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:rs,g2:rs,glyphName:rs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:pe,horizOriginX:pe,horizOriginY:pe,id:null,ideographic:pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:pe,k:pe,k1:pe,k2:pe,k3:pe,k4:pe,kernelMatrix:bn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:pe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:pe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:pe,overlineThickness:pe,paintOrder:null,panose1:null,path:null,pathLength:pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:pe,pointsAtY:pe,pointsAtZ:pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bn,rev:bn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bn,requiredFeatures:bn,requiredFonts:bn,requiredFormats:bn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:pe,specularExponent:pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:pe,strikethroughThickness:pe,string:null,stroke:null,strokeDashArray:bn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:pe,strokeOpacity:pe,strokeWidth:null,style:null,surfaceScale:pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bn,tabIndex:pe,tableValues:null,target:null,targetX:pe,targetY:pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:pe,underlineThickness:pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:pe,values:null,vAlphabetic:pe,vMathematical:pe,vectorEffect:null,vHanging:pe,vIdeographic:pe,version:null,vertAdvY:pe,vertOriginX:pe,vertOriginY:pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:V_}),G_=xs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Z_=xs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:q_}),Y_=xs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),bO={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},vO=/[A-Z]/g,yx=/-[a-z]/g,xO=/^data[-\w.:]+$/i;function wO(e,t){const n=kg(t);let r=t,s=on;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&xO.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(yx,SO);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!yx.test(l)){let o=l.replace(vO,_O);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=sm}return new s(r,t)}function _O(e){return"-"+e.toLowerCase()}function SO(e){return e.charAt(1).toUpperCase()}const kO=U_([$_,mO,G_,Z_,Y_],"html"),lm=U_([$_,yO,G_,Z_,Y_],"svg");function EO(e){return e.join(" ").trim()}var Ya={},Bh,bx;function AO(){if(bx)return Bh;bx=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
|
|
61
|
+
`,d="/",p="*",g="",m="comment",b="declaration";Bh=function(w,_){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];_=_||{};var k=1,A=1;function S(q){var R=q.match(t);R&&(k+=R.length);var $=q.lastIndexOf(f);A=~$?q.length-$:A+q.length}function O(){var q={line:k,column:A};return function(R){return R.position=new D(q),L(),R}}function D(q){this.start=q,this.end={line:k,column:A},this.source=_.source}D.prototype.content=w;function M(q){var R=new Error(_.source+":"+k+":"+A+": "+q);if(R.reason=q,R.filename=_.source,R.line=k,R.column=A,R.source=w,!_.silent)throw R}function F(q){var R=q.exec(w);if(R){var $=R[0];return S($),w=w.slice($.length),R}}function L(){F(n)}function U(q){var R;for(q=q||[];R=j();)R!==!1&&q.push(R);return q}function j(){var q=O();if(!(d!=w.charAt(0)||p!=w.charAt(1))){for(var R=2;g!=w.charAt(R)&&(p!=w.charAt(R)||d!=w.charAt(R+1));)++R;if(R+=2,g===w.charAt(R-1))return M("End of comment missing");var $=w.slice(2,R-2);return A+=2,S($),w=w.slice(R),A+=2,q({type:m,comment:$})}}function H(){var q=O(),R=F(r);if(R){if(j(),!F(s))return M("property missing ':'");var $=F(l),I=q({type:b,property:x(R[0].replace(e,g)),value:$?x($[0].replace(e,g)):g});return F(o),I}}function B(){var q=[];U(q);for(var R;R=H();)R!==!1&&(q.push(R),U(q));return q}return L(),B()};function x(w){return w?w.replace(c,g):g}return Bh}var vx;function TO(){if(vx)return Ya;vx=1;var e=Ya&&Ya.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.default=n;var t=e(AO());function n(r,s){var l=null;if(!r||typeof r!="string")return l;var o=(0,t.default)(r),c=typeof s=="function";return o.forEach(function(f){if(f.type==="declaration"){var d=f.property,p=f.value;c?s(d,p,f):p&&(l=l||{},l[d]=p)}}),l}return Ya}var Cl={},xx;function NO(){if(xx)return Cl;xx=1,Object.defineProperty(Cl,"__esModule",{value:!0}),Cl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,l=function(d){return!d||n.test(d)||e.test(d)},o=function(d,p){return p.toUpperCase()},c=function(d,p){return"".concat(p,"-")},f=function(d,p){return p===void 0&&(p={}),l(d)?d:(d=d.toLowerCase(),p.reactCompat?d=d.replace(s,c):d=d.replace(r,c),d.replace(t,o))};return Cl.camelCase=f,Cl}var Ol,wx;function CO(){if(wx)return Ol;wx=1;var e=Ol&&Ol.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(TO()),n=NO();function r(s,l){var o={};return!s||typeof s!="string"||(0,t.default)(s,function(c,f){c&&f&&(o[(0,n.camelCase)(c,l)]=f)}),o}return r.default=r,Ol=r,Ol}var OO=CO();const MO=ki(OO),X_=Q_("end"),om=Q_("start");function Q_(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function RO(e){const t=om(e),n=X_(e);if(t&&n)return{start:t,end:n}}function Fl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?_x(e.position):"start"in e||"end"in e?_x(e):"line"in e||"column"in e?Ag(e):""}function Ag(e){return Sx(e&&e.line)+":"+Sx(e&&e.column)}function _x(e){return Ag(e&&e.start)+"-"+Ag(e&&e.end)}function Sx(e){return e&&typeof e=="number"?e:1}class qt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",l={},o=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?s=t:!l.cause&&t&&(o=!0,s=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?l.ruleId=r:(l.source=r.slice(0,f),l.ruleId=r.slice(f+1))}if(!l.place&&l.ancestors&&l.ancestors){const f=l.ancestors[l.ancestors.length-1];f&&(l.place=f.position)}const c=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file,this.message=s,this.line=c?c.line:void 0,this.name=Fl(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual,this.expected,this.note,this.url}}qt.prototype.file="";qt.prototype.name="";qt.prototype.reason="";qt.prototype.message="";qt.prototype.stack="";qt.prototype.column=void 0;qt.prototype.line=void 0;qt.prototype.ancestors=void 0;qt.prototype.cause=void 0;qt.prototype.fatal=void 0;qt.prototype.place=void 0;qt.prototype.ruleId=void 0;qt.prototype.source=void 0;const um={}.hasOwnProperty,DO=new Map,jO=/[A-Z]/g,zO=new Set(["table","tbody","thead","tfoot","tr"]),LO=new Set(["td","th"]),K_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function IO(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=qO(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=VO(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?lm:kO,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=J_(s,e,void 0);return l&&typeof l!="string"?l:s.create(e,s.Fragment,{children:l||void 0},void 0)}function J_(e,t,n){if(t.type==="element")return BO(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return FO(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return UO(e,t,n);if(t.type==="mdxjsEsm")return PO(e,t);if(t.type==="root")return HO(e,t,n);if(t.type==="text")return $O(e,t)}function BO(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=lm,e.schema=s),e.ancestors.push(t);const l=eS(e,t.tagName,!1),o=GO(e,t);let c=fm(e,t);return zO.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!pO(f):!0})),W_(e,o,l,t),cm(o,c),e.ancestors.pop(),e.schema=r,e.create(t,l,o,n)}function FO(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Yl(e,t.position)}function PO(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Yl(e,t.position)}function UO(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=lm,e.schema=s),e.ancestors.push(t);const l=t.name===null?e.Fragment:eS(e,t.name,!0),o=ZO(e,t),c=fm(e,t);return W_(e,o,l,t),cm(o,c),e.ancestors.pop(),e.schema=r,e.create(t,l,o,n)}function HO(e,t,n){const r={};return cm(r,fm(e,t)),e.create(t,e.Fragment,r,n)}function $O(e,t){return t.value}function W_(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function cm(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function VO(e,t,n){return r;function r(s,l,o,c){const d=Array.isArray(o.children)?n:t;return c?d(l,o,c):d(l,o)}}function qO(e,t){return n;function n(r,s,l,o){const c=Array.isArray(l.children),f=om(r);return t(s,l,o,c,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function GO(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&um.call(t.properties,s)){const l=YO(e,s,t.properties[s]);if(l){const[o,c]=l;e.tableCellAlignToStyle&&o==="align"&&typeof c=="string"&&LO.has(t.tagName)?r=c:n[o]=c}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function ZO(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const o=l.expression;o.type;const c=o.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Yl(e,t.position);else{const s=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,l=e.evaluater.evaluateExpression(c.expression)}else Yl(e,t.position);else l=r.value===null?!0:r.value;n[s]=l}return n}function fm(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:DO;for(;++r<t.children.length;){const l=t.children[r];let o;if(e.passKeys){const f=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(f){const d=s.get(f)||0;o=f+"-"+d,s.set(f,d+1)}}const c=J_(e,l,o);c!==void 0&&n.push(c)}return n}function YO(e,t,n){const r=wO(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?uO(n):EO(n)),r.property==="style"){let s=typeof n=="object"?n:XO(e,String(n));return e.stylePropertyNameCase==="css"&&(s=QO(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?bO[r.property]||r.property:r.attribute,n]}}function XO(e,t){try{return MO(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new qt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=K_+"#cannot-parse-style-attribute",s}}function eS(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let l=-1,o;for(;++l<s.length;){const c=px(s[l])?{type:"Identifier",name:s[l]}:{type:"Literal",value:s[l]};o=o?{type:"MemberExpression",object:o,property:c,computed:!!(l&&c.type==="Literal"),optional:!1}:c}r=o}else r=px(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return um.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);Yl(e)}function Yl(e,t){const n=new qt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=K_+"#cannot-handle-mdx-estrees-without-createevaluater",n}function QO(e){const t={};let n;for(n in e)um.call(e,n)&&(t[KO(n)]=e[n]);return t}function KO(e){let t=e.replace(jO,JO);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function JO(e){return"-"+e.toLowerCase()}const Fh={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},WO={};function dm(e,t){const n=WO,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return tS(e,r,s)}function tS(e,t,n){if(eM(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return kx(e.children,t,n)}return Array.isArray(e)?kx(e,t,n):""}function kx(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=tS(e[s],t,n);return r.join("")}function eM(e){return!!(e&&typeof e=="object")}const Ex=document.createElement("i");function hm(e){const t="&"+e+";";Ex.innerHTML=t;const n=Ex.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function xn(e,t,n,r){const s=e.length;let l=0,o;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);l<r.length;)o=r.slice(l,l+1e4),o.unshift(t,0),e.splice(...o),l+=1e4,t+=1e4}function Mn(e,t){return e.length>0?(xn(e,e.length,0,t),e):t}const Ax={}.hasOwnProperty;function nS(e){const t={};let n=-1;for(;++n<e.length;)tM(t,e[n]);return t}function tM(e,t){let n;for(n in t){const s=(Ax.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let o;if(l)for(o in l){Ax.call(s,o)||(s[o]=[]);const c=l[o];nM(s[o],Array.isArray(c)?c:c?[c]:[])}}}function nM(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);xn(e,0,0,r)}function rS(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Gn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Qt=Ei(/[A-Za-z]/),Vt=Ei(/[\dA-Za-z]/),rM=Ei(/[#-'*+\--9=?A-Z^-~]/);function bc(e){return e!==null&&(e<32||e===127)}const Tg=Ei(/\d/),iM=Ei(/[\dA-Fa-f]/),aM=Ei(/[!-/:-@[-`{-~]/);function Ne(e){return e!==null&&e<-2}function st(e){return e!==null&&(e<0||e===32)}function $e(e){return e===-2||e===-1||e===32}const Pc=Ei(new RegExp("\\p{P}|\\p{S}","u")),ia=Ei(/\s/);function Ei(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ws(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const l=e.charCodeAt(n);let o="";if(l===37&&Vt(e.charCodeAt(n+1))&&Vt(e.charCodeAt(n+2)))s=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){const c=e.charCodeAt(n+1);l<56320&&c>56319&&c<57344?(o=String.fromCharCode(l,c),s=1):o="�"}else o=String.fromCharCode(l);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+s+1,o=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function qe(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(f){return $e(f)?(e.enter(n),c(f)):t(f)}function c(f){return $e(f)&&l++<s?(e.consume(f),c):(e.exit(n),t(f))}}const sM={tokenize:lM};function lM(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),qe(e,t,"linePrefix")}function s(c){return e.enter("paragraph"),l(c)}function l(c){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,o(c)}function o(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return Ne(c)?(e.consume(c),e.exit("chunkText"),l):(e.consume(c),o)}}const oM={tokenize:uM},Tx={tokenize:cM};function uM(e){const t=this,n=[];let r=0,s,l,o;return c;function c(S){if(r<n.length){const O=n[r];return t.containerState=O[1],e.attempt(O[0].continuation,f,d)(S)}return d(S)}function f(S){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&A();const O=t.events.length;let D=O,M;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){M=t.events[D][1].end;break}k(r);let F=O;for(;F<t.events.length;)t.events[F][1].end={...M},F++;return xn(t.events,D+1,0,t.events.slice(O)),t.events.length=F,d(S)}return c(S)}function d(S){if(r===n.length){if(!s)return m(S);if(s.currentConstruct&&s.currentConstruct.concrete)return x(S);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Tx,p,g)(S)}function p(S){return s&&A(),k(r),m(S)}function g(S){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,x(S)}function m(S){return t.containerState={},e.attempt(Tx,b,x)(S)}function b(S){return r++,n.push([t.currentConstruct,t.containerState]),m(S)}function x(S){if(S===null){s&&A(),k(0),e.consume(S);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:l}),w(S)}function w(S){if(S===null){_(e.exit("chunkFlow"),!0),k(0),e.consume(S);return}return Ne(S)?(e.consume(S),_(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(S),w)}function _(S,O){const D=t.sliceStream(S);if(O&&D.push(null),S.previous=l,l&&(l.next=S),l=S,s.defineSkip(S.start),s.write(D),t.parser.lazy[S.start.line]){let M=s.events.length;for(;M--;)if(s.events[M][1].start.offset<o&&(!s.events[M][1].end||s.events[M][1].end.offset>o))return;const F=t.events.length;let L=F,U,j;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(U){j=t.events[L][1].end;break}U=!0}for(k(r),M=F;M<t.events.length;)t.events[M][1].end={...j},M++;xn(t.events,L+1,0,t.events.slice(F)),t.events.length=M}}function k(S){let O=n.length;for(;O-- >S;){const D=n[O];t.containerState=D[1],D[0].exit.call(t,e)}n.length=S}function A(){s.write([null]),l=void 0,s=void 0,t.containerState._closeFlow=void 0}}function cM(e,t,n){return qe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ds(e){if(e===null||st(e)||ia(e))return 1;if(Pc(e))return 2}function Uc(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const l=e[s].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const Ng={name:"attention",resolveAll:fM,tokenize:dM};function fM(e,t){let n=-1,r,s,l,o,c,f,d,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[r][1].end},m={...e[n][1].start};Nx(g,-f),Nx(m,f),o={type:f>1?"strongSequence":"emphasisSequence",start:g,end:{...e[r][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},l={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:f>1?"strong":"emphasis",start:{...o.start},end:{...c.end}},e[r][1].end={...o.start},e[n][1].start={...c.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=Mn(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=Mn(d,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",l,t]]),d=Mn(d,Uc(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=Mn(d,[["exit",l,t],["enter",c,t],["exit",c,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,d=Mn(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,xn(e,r-1,n-r+3,d),n=r+d.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function dM(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=ds(r);let l;return o;function o(f){return l=f,e.enter("attentionSequence"),c(f)}function c(f){if(f===l)return e.consume(f),c;const d=e.exit("attentionSequence"),p=ds(f),g=!p||p===2&&s||n.includes(f),m=!s||s===2&&p||n.includes(r);return d._open=!!(l===42?g:g&&(s||!m)),d._close=!!(l===42?m:m&&(p||!g)),t(f)}}function Nx(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const hM={name:"autolink",tokenize:pM};function pM(e,t,n){let r=0;return s;function s(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(b){return Qt(b)?(e.consume(b),o):b===64?n(b):d(b)}function o(b){return b===43||b===45||b===46||Vt(b)?(r=1,c(b)):d(b)}function c(b){return b===58?(e.consume(b),r=0,f):(b===43||b===45||b===46||Vt(b))&&r++<32?(e.consume(b),c):(r=0,d(b))}function f(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||bc(b)?n(b):(e.consume(b),f)}function d(b){return b===64?(e.consume(b),p):rM(b)?(e.consume(b),d):n(b)}function p(b){return Vt(b)?g(b):n(b)}function g(b){return b===46?(e.consume(b),r=0,p):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):m(b)}function m(b){if((b===45||Vt(b))&&r++<63){const x=b===45?m:g;return e.consume(b),x}return n(b)}}const oo={partial:!0,tokenize:gM};function gM(e,t,n){return r;function r(l){return $e(l)?qe(e,s,"linePrefix")(l):s(l)}function s(l){return l===null||Ne(l)?t(l):n(l)}}const iS={continuation:{tokenize:yM},exit:bM,name:"blockQuote",tokenize:mM};function mM(e,t,n){const r=this;return s;function s(o){if(o===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),l}return n(o)}function l(o){return $e(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function yM(e,t,n){const r=this;return s;function s(o){return $e(o)?qe(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(iS,t,n)(o)}}function bM(e){e.exit("blockQuote")}const aS={name:"characterEscape",tokenize:vM};function vM(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),s}function s(l){return aM(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const sS={name:"characterReference",tokenize:xM};function xM(e,t,n){const r=this;let s=0,l,o;return c;function c(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),f}function f(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),l=31,o=Vt,p(g))}function d(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=iM,p):(e.enter("characterReferenceValue"),l=7,o=Tg,p(g))}function p(g){if(g===59&&s){const m=e.exit("characterReferenceValue");return o===Vt&&!hm(r.sliceSerialize(m))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(g)&&s++<l?(e.consume(g),p):n(g)}}const Cx={partial:!0,tokenize:_M},Ox={concrete:!0,name:"codeFenced",tokenize:wM};function wM(e,t,n){const r=this,s={partial:!0,tokenize:D};let l=0,o=0,c;return f;function f(M){return d(M)}function d(M){const F=r.events[r.events.length-1];return l=F&&F[1].type==="linePrefix"?F[2].sliceSerialize(F[1],!0).length:0,c=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(M)}function p(M){return M===c?(o++,e.consume(M),p):o<3?n(M):(e.exit("codeFencedFenceSequence"),$e(M)?qe(e,g,"whitespace")(M):g(M))}function g(M){return M===null||Ne(M)?(e.exit("codeFencedFence"),r.interrupt?t(M):e.check(Cx,w,O)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(M))}function m(M){return M===null||Ne(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(M)):$e(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),qe(e,b,"whitespace")(M)):M===96&&M===c?n(M):(e.consume(M),m)}function b(M){return M===null||Ne(M)?g(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(M))}function x(M){return M===null||Ne(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(M)):M===96&&M===c?n(M):(e.consume(M),x)}function w(M){return e.attempt(s,O,_)(M)}function _(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),k}function k(M){return l>0&&$e(M)?qe(e,A,"linePrefix",l+1)(M):A(M)}function A(M){return M===null||Ne(M)?e.check(Cx,w,O)(M):(e.enter("codeFlowValue"),S(M))}function S(M){return M===null||Ne(M)?(e.exit("codeFlowValue"),A(M)):(e.consume(M),S)}function O(M){return e.exit("codeFenced"),t(M)}function D(M,F,L){let U=0;return j;function j($){return M.enter("lineEnding"),M.consume($),M.exit("lineEnding"),H}function H($){return M.enter("codeFencedFence"),$e($)?qe(M,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):B($)}function B($){return $===c?(M.enter("codeFencedFenceSequence"),q($)):L($)}function q($){return $===c?(U++,M.consume($),q):U>=o?(M.exit("codeFencedFenceSequence"),$e($)?qe(M,R,"whitespace")($):R($)):L($)}function R($){return $===null||Ne($)?(M.exit("codeFencedFence"),F($)):L($)}}}function _M(e,t,n){const r=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Ph={name:"codeIndented",tokenize:kM},SM={partial:!0,tokenize:EM};function kM(e,t,n){const r=this;return s;function s(d){return e.enter("codeIndented"),qe(e,l,"linePrefix",5)(d)}function l(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?o(d):n(d)}function o(d){return d===null?f(d):Ne(d)?e.attempt(SM,o,f)(d):(e.enter("codeFlowValue"),c(d))}function c(d){return d===null||Ne(d)?(e.exit("codeFlowValue"),o(d)):(e.consume(d),c)}function f(d){return e.exit("codeIndented"),t(d)}}function EM(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):Ne(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):qe(e,l,"linePrefix",5)(o)}function l(o){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):Ne(o)?s(o):n(o)}}const AM={name:"codeText",previous:NM,resolve:TM,tokenize:CM};function TM(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function NM(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function CM(e,t,n){let r=0,s,l;return o;function o(g){return e.enter("codeText"),e.enter("codeTextSequence"),c(g)}function c(g){return g===96?(e.consume(g),r++,c):(e.exit("codeTextSequence"),f(g))}function f(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),f):g===96?(l=e.enter("codeTextSequence"),s=0,p(g)):Ne(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),f):(e.enter("codeTextData"),d(g))}function d(g){return g===null||g===32||g===96||Ne(g)?(e.exit("codeTextData"),f(g)):(e.consume(g),d)}function p(g){return g===96?(e.consume(g),s++,p):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(l.type="codeTextData",d(g))}}class OM{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Ml(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ml(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ml(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ml(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ml(this.left,n.reverse())}}}function Ml(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function lS(e){const t={};let n=-1,r,s,l,o,c,f,d;const p=new OM(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,l=0,l<f.length&&f[l][1].type==="lineEndingBlank"&&(l+=2),l<f.length&&f[l][1].type==="content"))for(;++l<f.length&&f[l][1].type!=="content";)f[l][1].type==="chunkText"&&(f[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,MM(p,n)),n=t[n],d=!0);else if(r[1]._container){for(l=n,s=void 0;l--;)if(o=p.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(p.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=l);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(r[1].end={...p.get(s)[1].start},c=p.slice(s,n),c.unshift(r),p.splice(s,n-s+1,c))}}return xn(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!d}function MM(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const l=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const c=o.events,f=[],d={};let p,g,m=-1,b=n,x=0,w=0;const _=[w];for(;b;){for(;e.get(++s)[1]!==b;);l.push(s),b._tokenizer||(p=r.sliceStream(b),b.next||p.push(null),g&&o.defineSkip(b.start),b._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(p),b._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),g=b,b=b.next}for(b=n;++m<c.length;)c[m][0]==="exit"&&c[m-1][0]==="enter"&&c[m][1].type===c[m-1][1].type&&c[m][1].start.line!==c[m][1].end.line&&(w=m+1,_.push(w),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(o.events=[],b?(b._tokenizer=void 0,b.previous=void 0):_.pop(),m=_.length;m--;){const k=c.slice(_[m],_[m+1]),A=l.pop();f.push([A,A+k.length-1]),e.splice(A,2,k)}for(f.reverse(),m=-1;++m<f.length;)d[x+f[m][0]]=x+f[m][1],x+=f[m][1]-f[m][0]-1;return d}const RM={resolve:jM,tokenize:zM},DM={partial:!0,tokenize:LM};function jM(e){return lS(e),e}function zM(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(c)}function s(c){return c===null?l(c):Ne(c)?e.check(DM,o,l)(c):(e.consume(c),s)}function l(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function o(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function LM(e,t,n){const r=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),qe(e,l,"linePrefix")}function l(o){if(o===null||Ne(o))return n(o);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function oS(e,t,n,r,s,l,o,c,f){const d=f||Number.POSITIVE_INFINITY;let p=0;return g;function g(k){return k===60?(e.enter(r),e.enter(s),e.enter(l),e.consume(k),e.exit(l),m):k===null||k===32||k===41||bc(k)?n(k):(e.enter(r),e.enter(o),e.enter(c),e.enter("chunkString",{contentType:"string"}),w(k))}function m(k){return k===62?(e.enter(l),e.consume(k),e.exit(l),e.exit(s),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),b(k))}function b(k){return k===62?(e.exit("chunkString"),e.exit(c),m(k)):k===null||k===60||Ne(k)?n(k):(e.consume(k),k===92?x:b)}function x(k){return k===60||k===62||k===92?(e.consume(k),b):b(k)}function w(k){return!p&&(k===null||k===41||st(k))?(e.exit("chunkString"),e.exit(c),e.exit(o),e.exit(r),t(k)):p<d&&k===40?(e.consume(k),p++,w):k===41?(e.consume(k),p--,w):k===null||k===32||k===40||bc(k)?n(k):(e.consume(k),k===92?_:w)}function _(k){return k===40||k===41||k===92?(e.consume(k),w):w(k)}}function uS(e,t,n,r,s,l){const o=this;let c=0,f;return d;function d(b){return e.enter(r),e.enter(s),e.consume(b),e.exit(s),e.enter(l),p}function p(b){return c>999||b===null||b===91||b===93&&!f||b===94&&!c&&"_hiddenFootnoteSupport"in o.parser.constructs?n(b):b===93?(e.exit(l),e.enter(s),e.consume(b),e.exit(s),e.exit(r),t):Ne(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||b===91||b===93||Ne(b)||c++>999?(e.exit("chunkString"),p(b)):(e.consume(b),f||(f=!$e(b)),b===92?m:g)}function m(b){return b===91||b===92||b===93?(e.consume(b),c++,g):g(b)}}function cS(e,t,n,r,s,l){let o;return c;function c(m){return m===34||m===39||m===40?(e.enter(r),e.enter(s),e.consume(m),e.exit(s),o=m===40?41:m,f):n(m)}function f(m){return m===o?(e.enter(s),e.consume(m),e.exit(s),e.exit(r),t):(e.enter(l),d(m))}function d(m){return m===o?(e.exit(l),f(o)):m===null?n(m):Ne(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),qe(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===o||m===null||Ne(m)?(e.exit("chunkString"),d(m)):(e.consume(m),m===92?g:p)}function g(m){return m===o||m===92?(e.consume(m),p):p(m)}}function Pl(e,t){let n;return r;function r(s){return Ne(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):$e(s)?qe(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const IM={name:"definition",tokenize:FM},BM={partial:!0,tokenize:PM};function FM(e,t,n){const r=this;let s;return l;function l(b){return e.enter("definition"),o(b)}function o(b){return uS.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function c(b){return s=Gn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),f):n(b)}function f(b){return st(b)?Pl(e,d)(b):d(b)}function d(b){return oS(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function p(b){return e.attempt(BM,g,g)(b)}function g(b){return $e(b)?qe(e,m,"whitespace")(b):m(b)}function m(b){return b===null||Ne(b)?(e.exit("definition"),r.parser.defined.push(s),t(b)):n(b)}}function PM(e,t,n){return r;function r(c){return st(c)?Pl(e,s)(c):n(c)}function s(c){return cS(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function l(c){return $e(c)?qe(e,o,"whitespace")(c):o(c)}function o(c){return c===null||Ne(c)?t(c):n(c)}}const UM={name:"hardBreakEscape",tokenize:HM};function HM(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),s}function s(l){return Ne(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const $M={name:"headingAtx",resolve:VM,tokenize:qM};function VM(e,t){let n=e.length-2,r=3,s,l;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},xn(e,r,n-r+1,[["enter",s,t],["enter",l,t],["exit",l,t],["exit",s,t]])),e}function qM(e,t,n){let r=0;return s;function s(p){return e.enter("atxHeading"),l(p)}function l(p){return e.enter("atxHeadingSequence"),o(p)}function o(p){return p===35&&r++<6?(e.consume(p),o):p===null||st(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),f(p)):p===null||Ne(p)?(e.exit("atxHeading"),t(p)):$e(p)?qe(e,c,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function f(p){return p===35?(e.consume(p),f):(e.exit("atxHeadingSequence"),c(p))}function d(p){return p===null||p===35||st(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),d)}}const GM=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Mx=["pre","script","style","textarea"],ZM={concrete:!0,name:"htmlFlow",resolveTo:QM,tokenize:KM},YM={partial:!0,tokenize:WM},XM={partial:!0,tokenize:JM};function QM(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function KM(e,t,n){const r=this;let s,l,o,c,f;return d;function d(T){return p(T)}function p(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),g}function g(T){return T===33?(e.consume(T),m):T===47?(e.consume(T),l=!0,w):T===63?(e.consume(T),s=3,r.interrupt?t:E):Qt(T)?(e.consume(T),o=String.fromCharCode(T),_):n(T)}function m(T){return T===45?(e.consume(T),s=2,b):T===91?(e.consume(T),s=5,c=0,x):Qt(T)?(e.consume(T),s=4,r.interrupt?t:E):n(T)}function b(T){return T===45?(e.consume(T),r.interrupt?t:E):n(T)}function x(T){const V="CDATA[";return T===V.charCodeAt(c++)?(e.consume(T),c===V.length?r.interrupt?t:B:x):n(T)}function w(T){return Qt(T)?(e.consume(T),o=String.fromCharCode(T),_):n(T)}function _(T){if(T===null||T===47||T===62||st(T)){const V=T===47,K=o.toLowerCase();return!V&&!l&&Mx.includes(K)?(s=1,r.interrupt?t(T):B(T)):GM.includes(o.toLowerCase())?(s=6,V?(e.consume(T),k):r.interrupt?t(T):B(T)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(T):l?A(T):S(T))}return T===45||Vt(T)?(e.consume(T),o+=String.fromCharCode(T),_):n(T)}function k(T){return T===62?(e.consume(T),r.interrupt?t:B):n(T)}function A(T){return $e(T)?(e.consume(T),A):j(T)}function S(T){return T===47?(e.consume(T),j):T===58||T===95||Qt(T)?(e.consume(T),O):$e(T)?(e.consume(T),S):j(T)}function O(T){return T===45||T===46||T===58||T===95||Vt(T)?(e.consume(T),O):D(T)}function D(T){return T===61?(e.consume(T),M):$e(T)?(e.consume(T),D):S(T)}function M(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),f=T,F):$e(T)?(e.consume(T),M):L(T)}function F(T){return T===f?(e.consume(T),f=null,U):T===null||Ne(T)?n(T):(e.consume(T),F)}function L(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||st(T)?D(T):(e.consume(T),L)}function U(T){return T===47||T===62||$e(T)?S(T):n(T)}function j(T){return T===62?(e.consume(T),H):n(T)}function H(T){return T===null||Ne(T)?B(T):$e(T)?(e.consume(T),H):n(T)}function B(T){return T===45&&s===2?(e.consume(T),I):T===60&&s===1?(e.consume(T),P):T===62&&s===4?(e.consume(T),G):T===63&&s===3?(e.consume(T),E):T===93&&s===5?(e.consume(T),X):Ne(T)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(YM,te,q)(T)):T===null||Ne(T)?(e.exit("htmlFlowData"),q(T)):(e.consume(T),B)}function q(T){return e.check(XM,R,te)(T)}function R(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),$}function $(T){return T===null||Ne(T)?q(T):(e.enter("htmlFlowData"),B(T))}function I(T){return T===45?(e.consume(T),E):B(T)}function P(T){return T===47?(e.consume(T),o="",Y):B(T)}function Y(T){if(T===62){const V=o.toLowerCase();return Mx.includes(V)?(e.consume(T),G):B(T)}return Qt(T)&&o.length<8?(e.consume(T),o+=String.fromCharCode(T),Y):B(T)}function X(T){return T===93?(e.consume(T),E):B(T)}function E(T){return T===62?(e.consume(T),G):T===45&&s===2?(e.consume(T),E):B(T)}function G(T){return T===null||Ne(T)?(e.exit("htmlFlowData"),te(T)):(e.consume(T),G)}function te(T){return e.exit("htmlFlow"),t(T)}}function JM(e,t,n){const r=this;return s;function s(o){return Ne(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):n(o)}function l(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function WM(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(oo,t,n)}}const e4={name:"htmlText",tokenize:t4};function t4(e,t,n){const r=this;let s,l,o;return c;function c(E){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(E),f}function f(E){return E===33?(e.consume(E),d):E===47?(e.consume(E),D):E===63?(e.consume(E),S):Qt(E)?(e.consume(E),L):n(E)}function d(E){return E===45?(e.consume(E),p):E===91?(e.consume(E),l=0,x):Qt(E)?(e.consume(E),A):n(E)}function p(E){return E===45?(e.consume(E),b):n(E)}function g(E){return E===null?n(E):E===45?(e.consume(E),m):Ne(E)?(o=g,P(E)):(e.consume(E),g)}function m(E){return E===45?(e.consume(E),b):g(E)}function b(E){return E===62?I(E):E===45?m(E):g(E)}function x(E){const G="CDATA[";return E===G.charCodeAt(l++)?(e.consume(E),l===G.length?w:x):n(E)}function w(E){return E===null?n(E):E===93?(e.consume(E),_):Ne(E)?(o=w,P(E)):(e.consume(E),w)}function _(E){return E===93?(e.consume(E),k):w(E)}function k(E){return E===62?I(E):E===93?(e.consume(E),k):w(E)}function A(E){return E===null||E===62?I(E):Ne(E)?(o=A,P(E)):(e.consume(E),A)}function S(E){return E===null?n(E):E===63?(e.consume(E),O):Ne(E)?(o=S,P(E)):(e.consume(E),S)}function O(E){return E===62?I(E):S(E)}function D(E){return Qt(E)?(e.consume(E),M):n(E)}function M(E){return E===45||Vt(E)?(e.consume(E),M):F(E)}function F(E){return Ne(E)?(o=F,P(E)):$e(E)?(e.consume(E),F):I(E)}function L(E){return E===45||Vt(E)?(e.consume(E),L):E===47||E===62||st(E)?U(E):n(E)}function U(E){return E===47?(e.consume(E),I):E===58||E===95||Qt(E)?(e.consume(E),j):Ne(E)?(o=U,P(E)):$e(E)?(e.consume(E),U):I(E)}function j(E){return E===45||E===46||E===58||E===95||Vt(E)?(e.consume(E),j):H(E)}function H(E){return E===61?(e.consume(E),B):Ne(E)?(o=H,P(E)):$e(E)?(e.consume(E),H):U(E)}function B(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),s=E,q):Ne(E)?(o=B,P(E)):$e(E)?(e.consume(E),B):(e.consume(E),R)}function q(E){return E===s?(e.consume(E),s=void 0,$):E===null?n(E):Ne(E)?(o=q,P(E)):(e.consume(E),q)}function R(E){return E===null||E===34||E===39||E===60||E===61||E===96?n(E):E===47||E===62||st(E)?U(E):(e.consume(E),R)}function $(E){return E===47||E===62||st(E)?U(E):n(E)}function I(E){return E===62?(e.consume(E),e.exit("htmlTextData"),e.exit("htmlText"),t):n(E)}function P(E){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),Y}function Y(E){return $e(E)?qe(e,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):X(E)}function X(E){return e.enter("htmlTextData"),o(E)}}const pm={name:"labelEnd",resolveAll:a4,resolveTo:s4,tokenize:l4},n4={tokenize:o4},r4={tokenize:u4},i4={tokenize:c4};function a4(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&xn(e,0,e.length,n),e}function s4(e,t){let n=e.length,r=0,s,l,o,c;for(;n--;)if(s=e[n][1],l){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(l=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(o=n);const f={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},p={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[o-2][1].start}};return c=[["enter",f,t],["enter",d,t]],c=Mn(c,e.slice(l+1,l+r+3)),c=Mn(c,[["enter",p,t]]),c=Mn(c,Uc(t.parser.constructs.insideSpan.null,e.slice(l+r+4,o-3),t)),c=Mn(c,[["exit",p,t],e[o-2],e[o-1],["exit",d,t]]),c=Mn(c,e.slice(o+1)),c=Mn(c,[["exit",f,t]]),xn(e,l,e.length,c),e}function l4(e,t,n){const r=this;let s=r.events.length,l,o;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){l=r.events[s][1];break}return c;function c(m){return l?l._inactive?g(m):(o=r.parser.defined.includes(Gn(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),f):n(m)}function f(m){return m===40?e.attempt(n4,p,o?p:g)(m):m===91?e.attempt(r4,p,o?d:g)(m):o?p(m):g(m)}function d(m){return e.attempt(i4,p,g)(m)}function p(m){return t(m)}function g(m){return l._balanced=!0,n(m)}}function o4(e,t,n){return r;function r(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),s}function s(g){return st(g)?Pl(e,l)(g):l(g)}function l(g){return g===41?p(g):oS(e,o,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function o(g){return st(g)?Pl(e,f)(g):p(g)}function c(g){return n(g)}function f(g){return g===34||g===39||g===40?cS(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):p(g)}function d(g){return st(g)?Pl(e,p)(g):p(g)}function p(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function u4(e,t,n){const r=this;return s;function s(c){return uS.call(r,e,l,o,"reference","referenceMarker","referenceString")(c)}function l(c){return r.parser.defined.includes(Gn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function o(c){return n(c)}}function c4(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),s}function s(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const f4={name:"labelStartImage",resolveAll:pm.resolveAll,tokenize:d4};function d4(e,t,n){const r=this;return s;function s(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),l}function l(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),o):n(c)}function o(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const h4={name:"labelStartLink",resolveAll:pm.resolveAll,tokenize:p4};function p4(e,t,n){const r=this;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Uh={name:"lineEnding",tokenize:g4};function g4(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),qe(e,t,"linePrefix")}}const sc={name:"thematicBreak",tokenize:m4};function m4(e,t,n){let r=0,s;return l;function l(d){return e.enter("thematicBreak"),o(d)}function o(d){return s=d,c(d)}function c(d){return d===s?(e.enter("thematicBreakSequence"),f(d)):r>=3&&(d===null||Ne(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===s?(e.consume(d),r++,f):(e.exit("thematicBreakSequence"),$e(d)?qe(e,c,"whitespace")(d):c(d))}}const sn={continuation:{tokenize:x4},exit:_4,name:"list",tokenize:v4},y4={partial:!0,tokenize:S4},b4={partial:!0,tokenize:w4};function v4(e,t,n){const r=this,s=r.events[r.events.length-1];let l=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return c;function c(b){const x=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:Tg(b)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(sc,n,d)(b):d(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(b)}return n(b)}function f(b){return Tg(b)&&++o<10?(e.consume(b),f):(!r.interrupt||o<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),d(b)):n(b)}function d(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(oo,r.interrupt?n:p,e.attempt(y4,m,g))}function p(b){return r.containerState.initialBlankLine=!0,l++,m(b)}function g(b){return $e(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),m):n(b)}function m(b){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function x4(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(oo,s,l);function s(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,qe(e,t,"listItemIndent",r.containerState.size+1)(c)}function l(c){return r.containerState.furtherBlankLines||!$e(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(b4,t,o)(c))}function o(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,qe(e,e.attempt(sn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function w4(e,t,n){const r=this;return qe(e,s,"listItemIndent",r.containerState.size+1);function s(l){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(l):n(l)}}function _4(e){e.exit(this.containerState.type)}function S4(e,t,n){const r=this;return qe(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(l){const o=r.events[r.events.length-1];return!$e(l)&&o&&o[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const Rx={name:"setextUnderline",resolveTo:k4,tokenize:E4};function k4(e,t){let n=e.length,r,s,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",l?(e.splice(s,0,["enter",o,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function E4(e,t,n){const r=this;let s;return l;function l(d){let p=r.events.length,g;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){g=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||g)?(e.enter("setextHeadingLine"),s=d,o(d)):n(d)}function o(d){return e.enter("setextHeadingLineSequence"),c(d)}function c(d){return d===s?(e.consume(d),c):(e.exit("setextHeadingLineSequence"),$e(d)?qe(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||Ne(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const A4={tokenize:T4};function T4(e){const t=this,n=e.attempt(oo,r,e.attempt(this.parser.constructs.flowInitial,s,qe(e,e.attempt(this.parser.constructs.flow,s,e.attempt(RM,s)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const N4={resolveAll:dS()},C4=fS("string"),O4=fS("text");function fS(e){return{resolveAll:dS(e==="text"?M4:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],l=n.attempt(s,o,c);return o;function o(p){return d(p)?l(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),f}function f(p){return d(p)?(n.exit("data"),l(p)):(n.consume(p),f)}function d(p){if(p===null)return!0;const g=s[p];let m=-1;if(g)for(;++m<g.length;){const b=g[m];if(!b.previous||b.previous.call(r,r.previous))return!0}return!1}}}function dS(e){return t;function t(n,r){let s=-1,l;for(;++s<=n.length;)l===void 0?n[s]&&n[s][1].type==="data"&&(l=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==l+2&&(n[l][1].end=n[s-1][1].end,n.splice(l+2,s-l-2),s=l+2),l=void 0);return e?e(n,r):n}}function M4(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let l=s.length,o=-1,c=0,f;for(;l--;){const d=s[l];if(typeof d=="string"){for(o=d.length;d.charCodeAt(o-1)===32;)c++,o--;if(o)break;o=-1}else if(d===-2)f=!0,c++;else if(d!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const d={type:n===e.length||f||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:r.start._bufferIndex+o,_index:r.start._index+l,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const R4={42:sn,43:sn,45:sn,48:sn,49:sn,50:sn,51:sn,52:sn,53:sn,54:sn,55:sn,56:sn,57:sn,62:iS},D4={91:IM},j4={[-2]:Ph,[-1]:Ph,32:Ph},z4={35:$M,42:sc,45:[Rx,sc],60:ZM,61:Rx,95:sc,96:Ox,126:Ox},L4={38:sS,92:aS},I4={[-5]:Uh,[-4]:Uh,[-3]:Uh,33:f4,38:sS,42:Ng,60:[hM,e4],91:h4,92:[UM,aS],93:pm,95:Ng,96:AM},B4={null:[Ng,N4]},F4={null:[42,95]},P4={null:[]},U4=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:F4,contentInitial:D4,disable:P4,document:R4,flow:z4,flowInitial:j4,insideSpan:B4,string:L4,text:I4},Symbol.toStringTag,{value:"Module"}));function H4(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},l=[];let o=[],c=[];const f={attempt:F(D),check:F(M),consume:A,enter:S,exit:O,interrupt:F(M,{interrupt:!0})},d={code:null,containerState:{},defineSkip:w,events:[],now:x,parser:e,previous:null,sliceSerialize:m,sliceStream:b,write:g};let p=t.tokenize.call(d,f);return t.resolveAll&&l.push(t),d;function g(H){return o=Mn(o,H),_(),o[o.length-1]!==null?[]:(L(t,0),d.events=Uc(l,d.events,d),d.events)}function m(H,B){return V4(b(H),B)}function b(H){return $4(o,H)}function x(){const{_bufferIndex:H,_index:B,line:q,column:R,offset:$}=r;return{_bufferIndex:H,_index:B,line:q,column:R,offset:$}}function w(H){s[H.line]=H.column,j()}function _(){let H;for(;r._index<o.length;){const B=o[r._index];if(typeof B=="string")for(H=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===H&&r._bufferIndex<B.length;)k(B.charCodeAt(r._bufferIndex));else k(B)}}function k(H){p=p(H)}function A(H){Ne(H)?(r.line++,r.column=1,r.offset+=H===-3?2:1,j()):H!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=H}function S(H,B){const q=B||{};return q.type=H,q.start=x(),d.events.push(["enter",q,d]),c.push(q),q}function O(H){const B=c.pop();return B.end=x(),d.events.push(["exit",B,d]),B}function D(H,B){L(H,B.from)}function M(H,B){B.restore()}function F(H,B){return q;function q(R,$,I){let P,Y,X,E;return Array.isArray(R)?te(R):"tokenize"in R?te([R]):G(R);function G(J){return le;function le(fe){const ye=fe!==null&&J[fe],Ae=fe!==null&&J.null,Se=[...Array.isArray(ye)?ye:ye?[ye]:[],...Array.isArray(Ae)?Ae:Ae?[Ae]:[]];return te(Se)(fe)}}function te(J){return P=J,Y=0,J.length===0?I:T(J[Y])}function T(J){return le;function le(fe){return E=U(),X=J,J.partial||(d.currentConstruct=J),J.name&&d.parser.constructs.disable.null.includes(J.name)?K():J.tokenize.call(B?Object.assign(Object.create(d),B):d,f,V,K)(fe)}}function V(J){return H(X,E),$}function K(J){return E.restore(),++Y<P.length?T(P[Y]):I}}}function L(H,B){H.resolveAll&&!l.includes(H)&&l.push(H),H.resolve&&xn(d.events,B,d.events.length-B,H.resolve(d.events.slice(B),d)),H.resolveTo&&(d.events=H.resolveTo(d.events,d))}function U(){const H=x(),B=d.previous,q=d.currentConstruct,R=d.events.length,$=Array.from(c);return{from:R,restore:I};function I(){r=H,d.previous=B,d.currentConstruct=q,d.events.length=R,c=$,j()}}function j(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function $4(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,l=t.end._bufferIndex;let o;if(n===s)o=[e[n].slice(r,l)];else{if(o=e.slice(n,s),r>-1){const c=o[0];typeof c=="string"?o[0]=c.slice(r):o.shift()}l>0&&o.push(e[s].slice(0,l))}return o}function V4(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const l=e[n];let o;if(typeof l=="string")o=l;else switch(l){case-5:{o="\r";break}case-4:{o=`
|
|
62
62
|
`;break}case-3:{o=`\r
|
|
63
|
-
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(l)}s=l===-2,r.push(o)}return r.join("")}function q4(e){const r={constructs:tS([U4,...(e||{}).extensions||[]]),content:s(sM),defined:[],document:s(oM),flow:s(A4),lazy:{},string:s(N4),text:s(O4)};return r;function s(l){return o;function o(c){return H4(r,l,c)}}}function G4(e){for(;!sS(e););return e}const Rx=/[\0\t\n\r]/g;function Z4(){let e=1,t="",n=!0,r;return s;function s(l,o,c){const f=[];let d,p,g,m,b;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l)),g=0,t="",n&&(l.charCodeAt(0)===65279&&g++,n=void 0);g<l.length;){if(Rx.lastIndex=g,d=Rx.exec(l),m=d&&d.index!==void 0?d.index:l.length,b=l.charCodeAt(m),!d){t=l.slice(g);break}if(b===10&&g===m&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),g<m&&(f.push(l.slice(g,m)),e+=m-g),b){case 0:{f.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,f.push(-2);e++<p;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}g=m+1}return c&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const Y4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function X4(e){return e.replace(Y4,Q4)}function Q4(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),l=s===120||s===88;return nS(n.slice(l?2:1),l?16:10)}return hm(n)||e}const dS={}.hasOwnProperty;function K4(e,t,n){return typeof t!="string"&&(n=t,t=void 0),J4(n)(G4(q4(n).document().write(Z4()(e,t,!0))))}function J4(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(fr),autolinkProtocol:U,autolinkEmail:U,atxHeading:l(lt),blockQuote:l(Ae),characterEscape:U,characterReference:U,codeFenced:l(Se),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(Se,o),codeText:l(be,o),codeTextData:U,data:U,codeFlowValue:U,definition:l(je),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(ze),hardBreakEscape:l(ft),hardBreakTrailing:l(ft),htmlFlow:l(xt,o),htmlFlowData:U,htmlText:l(xt,o),htmlTextData:U,image:l(Ai),label:o,link:l(fr),listItem:l(Xn),listItemValue:m,listOrdered:l(Dn,g),listUnordered:l(Dn),paragraph:l(dr),reference:T,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(lt),strong:l(Qn),thematicBreak:l(Kn)},exit:{atxHeading:f(),atxHeadingSequence:D,autolink:f(),autolinkEmail:ye,autolinkProtocol:fe,blockQuote:f(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:K,characterReferenceMarkerNumeric:K,characterReferenceValue:J,characterReference:le,codeFenced:f(_),codeFencedFence:w,codeFencedFenceInfo:b,codeFencedFenceMeta:x,codeFlowValue:j,codeIndented:f(k),codeText:f($),codeTextData:j,data:j,definition:f(),definitionDestinationString:O,definitionLabelString:A,definitionTitleString:S,emphasis:f(),hardBreakEscape:f(B),hardBreakTrailing:f(B),htmlFlow:f(q),htmlFlowData:j,htmlText:f(R),htmlTextData:j,image:f(P),label:X,labelText:Y,lineEnding:H,link:f(I),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:V,resourceDestinationString:E,resourceTitleString:G,resource:te,setextHeading:f(L),setextHeadingLineSequence:F,setextHeadingText:M,strong:f(),thematicBreak:f()}};hS(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(se){let he={type:"root",children:[]};const Ee={stack:[he],tokenStack:[],config:t,enter:c,exit:d,buffer:o,resume:p,data:n},Te=[];let Qe=-1;for(;++Qe<se.length;)if(se[Qe][1].type==="listOrdered"||se[Qe][1].type==="listUnordered")if(se[Qe][0]==="enter")Te.push(Qe);else{const Gt=Te.pop();Qe=s(se,Gt,Qe)}for(Qe=-1;++Qe<se.length;){const Gt=t[se[Qe][0]];dS.call(Gt,se[Qe][1].type)&&Gt[se[Qe][1].type].call(Object.assign({sliceSerialize:se[Qe][2].sliceSerialize},Ee),se[Qe][1])}if(Ee.tokenStack.length>0){const Gt=Ee.tokenStack[Ee.tokenStack.length-1];(Gt[1]||Dx).call(Ee,void 0,Gt[0])}for(he.position={start:hi(se.length>0?se[0][1].start:{line:1,column:1,offset:0}),end:hi(se.length>0?se[se.length-2][1].end:{line:1,column:1,offset:0})},Qe=-1;++Qe<t.transforms.length;)he=t.transforms[Qe](he)||he;return he}function s(se,he,Ee){let Te=he-1,Qe=-1,Gt=!1,jn,Pt,Sn,Zt;for(;++Te<=Ee;){const wt=se[Te];switch(wt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{wt[0]==="enter"?Qe++:Qe--,Zt=void 0;break}case"lineEndingBlank":{wt[0]==="enter"&&(jn&&!Zt&&!Qe&&!Sn&&(Sn=Te),Zt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Zt=void 0}if(!Qe&&wt[0]==="enter"&&wt[1].type==="listItemPrefix"||Qe===-1&&wt[0]==="exit"&&(wt[1].type==="listUnordered"||wt[1].type==="listOrdered")){if(jn){let Kt=Te;for(Pt=void 0;Kt--;){const un=se[Kt];if(un[1].type==="lineEnding"||un[1].type==="lineEndingBlank"){if(un[0]==="exit")continue;Pt&&(se[Pt][1].type="lineEndingBlank",Gt=!0),un[1].type="lineEnding",Pt=Kt}else if(!(un[1].type==="linePrefix"||un[1].type==="blockQuotePrefix"||un[1].type==="blockQuotePrefixWhitespace"||un[1].type==="blockQuoteMarker"||un[1].type==="listItemIndent"))break}Sn&&(!Pt||Sn<Pt)&&(jn._spread=!0),jn.end=Object.assign({},Pt?se[Pt][1].start:wt[1].end),se.splice(Pt||Te,0,["exit",jn,wt[2]]),Te++,Ee++}if(wt[1].type==="listItemPrefix"){const Kt={type:"listItem",_spread:!1,start:Object.assign({},wt[1].start),end:void 0};jn=Kt,se.splice(Te,0,["enter",Kt,wt[2]]),Te++,Ee++,Sn=void 0,Zt=!0}}}return se[he][1]._spread=Gt,Ee}function l(se,he){return Ee;function Ee(Te){c.call(this,se(Te),Te),he&&he.call(this,Te)}}function o(){this.stack.push({type:"fragment",children:[]})}function c(se,he,Ee){this.stack[this.stack.length-1].children.push(se),this.stack.push(se),this.tokenStack.push([he,Ee||void 0]),se.position={start:hi(he.start),end:void 0}}function f(se){return he;function he(Ee){se&&se.call(this,Ee),d.call(this,Ee)}}function d(se,he){const Ee=this.stack.pop(),Te=this.tokenStack.pop();if(Te)Te[0].type!==se.type&&(he?he.call(this,se,Te[0]):(Te[1]||Dx).call(this,se,Te[0]));else throw new Error("Cannot close `"+se.type+"` ("+Fl({start:se.start,end:se.end})+"): it’s not open");Ee.position.end=hi(se.end)}function p(){return dm(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function m(se){if(this.data.expectingFirstListItemValue){const he=this.stack[this.stack.length-2];he.start=Number.parseInt(this.sliceSerialize(se),10),this.data.expectingFirstListItemValue=void 0}}function b(){const se=this.resume(),he=this.stack[this.stack.length-1];he.lang=se}function x(){const se=this.resume(),he=this.stack[this.stack.length-1];he.meta=se}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){const se=this.resume(),he=this.stack[this.stack.length-1];he.value=se.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const se=this.resume(),he=this.stack[this.stack.length-1];he.value=se.replace(/(\r?\n|\r)$/g,"")}function A(se){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=he,Ee.identifier=Gn(this.sliceSerialize(se)).toLowerCase()}function S(){const se=this.resume(),he=this.stack[this.stack.length-1];he.title=se}function O(){const se=this.resume(),he=this.stack[this.stack.length-1];he.url=se}function D(se){const he=this.stack[this.stack.length-1];if(!he.depth){const Ee=this.sliceSerialize(se).length;he.depth=Ee}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function F(se){const he=this.stack[this.stack.length-1];he.depth=this.sliceSerialize(se).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function U(se){const Ee=this.stack[this.stack.length-1].children;let Te=Ee[Ee.length-1];(!Te||Te.type!=="text")&&(Te=Ti(),Te.position={start:hi(se.start),end:void 0},Ee.push(Te)),this.stack.push(Te)}function j(se){const he=this.stack.pop();he.value+=this.sliceSerialize(se),he.position.end=hi(se.end)}function H(se){const he=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=he.children[he.children.length-1];Ee.position.end=hi(se.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(he.type)&&(U.call(this,se),j.call(this,se))}function B(){this.data.atHardBreak=!0}function q(){const se=this.resume(),he=this.stack[this.stack.length-1];he.value=se}function R(){const se=this.resume(),he=this.stack[this.stack.length-1];he.value=se}function $(){const se=this.resume(),he=this.stack[this.stack.length-1];he.value=se}function I(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=he,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function P(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=he,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function Y(se){const he=this.sliceSerialize(se),Ee=this.stack[this.stack.length-2];Ee.label=X4(he),Ee.identifier=Gn(he).toLowerCase()}function X(){const se=this.stack[this.stack.length-1],he=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const Te=se.children;Ee.children=Te}else Ee.alt=he}function E(){const se=this.resume(),he=this.stack[this.stack.length-1];he.url=se}function G(){const se=this.resume(),he=this.stack[this.stack.length-1];he.title=se}function te(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function V(se){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=he,Ee.identifier=Gn(this.sliceSerialize(se)).toLowerCase(),this.data.referenceType="full"}function K(se){this.data.characterReferenceType=se.type}function J(se){const he=this.sliceSerialize(se),Ee=this.data.characterReferenceType;let Te;Ee?(Te=nS(he,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Te=hm(he);const Qe=this.stack[this.stack.length-1];Qe.value+=Te}function le(se){const he=this.stack.pop();he.position.end=hi(se.end)}function fe(se){j.call(this,se);const he=this.stack[this.stack.length-1];he.url=this.sliceSerialize(se)}function ye(se){j.call(this,se);const he=this.stack[this.stack.length-1];he.url="mailto:"+this.sliceSerialize(se)}function Ae(){return{type:"blockquote",children:[]}}function Se(){return{type:"code",lang:null,meta:null,value:""}}function be(){return{type:"inlineCode",value:""}}function je(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ze(){return{type:"emphasis",children:[]}}function lt(){return{type:"heading",depth:0,children:[]}}function ft(){return{type:"break"}}function xt(){return{type:"html",value:""}}function Ai(){return{type:"image",title:null,url:"",alt:null}}function fr(){return{type:"link",title:null,url:"",children:[]}}function Dn(se){return{type:"list",ordered:se.type==="listOrdered",start:null,spread:se._spread,children:[]}}function Xn(se){return{type:"listItem",spread:se._spread,checked:null,children:[]}}function dr(){return{type:"paragraph",children:[]}}function Qn(){return{type:"strong",children:[]}}function Ti(){return{type:"text",value:""}}function Kn(){return{type:"thematicBreak"}}}function hi(e){return{line:e.line,column:e.column,offset:e.offset}}function hS(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?hS(e,r):W4(e,r)}}function W4(e,t){let n;for(n in t)if(dS.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Dx(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Fl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Fl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Fl({start:t.start,end:t.end})+") is still open")}function eR(e){const t=this;t.parser=n;function n(r){return K4(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function tR(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function nR(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
63
|
+
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(l)}s=l===-2,r.push(o)}return r.join("")}function q4(e){const r={constructs:nS([U4,...(e||{}).extensions||[]]),content:s(sM),defined:[],document:s(oM),flow:s(A4),lazy:{},string:s(C4),text:s(O4)};return r;function s(l){return o;function o(c){return H4(r,l,c)}}}function G4(e){for(;!lS(e););return e}const Dx=/[\0\t\n\r]/g;function Z4(){let e=1,t="",n=!0,r;return s;function s(l,o,c){const f=[];let d,p,g,m,b;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l)),g=0,t="",n&&(l.charCodeAt(0)===65279&&g++,n=void 0);g<l.length;){if(Dx.lastIndex=g,d=Dx.exec(l),m=d&&d.index!==void 0?d.index:l.length,b=l.charCodeAt(m),!d){t=l.slice(g);break}if(b===10&&g===m&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),g<m&&(f.push(l.slice(g,m)),e+=m-g),b){case 0:{f.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,f.push(-2);e++<p;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}g=m+1}return c&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const Y4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function X4(e){return e.replace(Y4,Q4)}function Q4(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),l=s===120||s===88;return rS(n.slice(l?2:1),l?16:10)}return hm(n)||e}const hS={}.hasOwnProperty;function K4(e,t,n){return typeof t!="string"&&(n=t,t=void 0),J4(n)(G4(q4(n).document().write(Z4()(e,t,!0))))}function J4(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(fr),autolinkProtocol:U,autolinkEmail:U,atxHeading:l(lt),blockQuote:l(Ae),characterEscape:U,characterReference:U,codeFenced:l(Se),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(Se,o),codeText:l(be,o),codeTextData:U,data:U,codeFlowValue:U,definition:l(je),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(ze),hardBreakEscape:l(ft),hardBreakTrailing:l(ft),htmlFlow:l(xt,o),htmlFlowData:U,htmlText:l(xt,o),htmlTextData:U,image:l(Ai),label:o,link:l(fr),listItem:l(Xn),listItemValue:m,listOrdered:l(Dn,g),listUnordered:l(Dn),paragraph:l(dr),reference:T,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(lt),strong:l(Qn),thematicBreak:l(Kn)},exit:{atxHeading:f(),atxHeadingSequence:D,autolink:f(),autolinkEmail:ye,autolinkProtocol:fe,blockQuote:f(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:K,characterReferenceMarkerNumeric:K,characterReferenceValue:J,characterReference:le,codeFenced:f(_),codeFencedFence:w,codeFencedFenceInfo:b,codeFencedFenceMeta:x,codeFlowValue:j,codeIndented:f(k),codeText:f($),codeTextData:j,data:j,definition:f(),definitionDestinationString:O,definitionLabelString:A,definitionTitleString:S,emphasis:f(),hardBreakEscape:f(B),hardBreakTrailing:f(B),htmlFlow:f(q),htmlFlowData:j,htmlText:f(R),htmlTextData:j,image:f(P),label:X,labelText:Y,lineEnding:H,link:f(I),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:V,resourceDestinationString:E,resourceTitleString:G,resource:te,setextHeading:f(L),setextHeadingLineSequence:F,setextHeadingText:M,strong:f(),thematicBreak:f()}};pS(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(se){let he={type:"root",children:[]};const Ee={stack:[he],tokenStack:[],config:t,enter:c,exit:d,buffer:o,resume:p,data:n},Te=[];let Qe=-1;for(;++Qe<se.length;)if(se[Qe][1].type==="listOrdered"||se[Qe][1].type==="listUnordered")if(se[Qe][0]==="enter")Te.push(Qe);else{const Gt=Te.pop();Qe=s(se,Gt,Qe)}for(Qe=-1;++Qe<se.length;){const Gt=t[se[Qe][0]];hS.call(Gt,se[Qe][1].type)&&Gt[se[Qe][1].type].call(Object.assign({sliceSerialize:se[Qe][2].sliceSerialize},Ee),se[Qe][1])}if(Ee.tokenStack.length>0){const Gt=Ee.tokenStack[Ee.tokenStack.length-1];(Gt[1]||jx).call(Ee,void 0,Gt[0])}for(he.position={start:hi(se.length>0?se[0][1].start:{line:1,column:1,offset:0}),end:hi(se.length>0?se[se.length-2][1].end:{line:1,column:1,offset:0})},Qe=-1;++Qe<t.transforms.length;)he=t.transforms[Qe](he)||he;return he}function s(se,he,Ee){let Te=he-1,Qe=-1,Gt=!1,jn,Pt,Sn,Zt;for(;++Te<=Ee;){const wt=se[Te];switch(wt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{wt[0]==="enter"?Qe++:Qe--,Zt=void 0;break}case"lineEndingBlank":{wt[0]==="enter"&&(jn&&!Zt&&!Qe&&!Sn&&(Sn=Te),Zt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Zt=void 0}if(!Qe&&wt[0]==="enter"&&wt[1].type==="listItemPrefix"||Qe===-1&&wt[0]==="exit"&&(wt[1].type==="listUnordered"||wt[1].type==="listOrdered")){if(jn){let Kt=Te;for(Pt=void 0;Kt--;){const un=se[Kt];if(un[1].type==="lineEnding"||un[1].type==="lineEndingBlank"){if(un[0]==="exit")continue;Pt&&(se[Pt][1].type="lineEndingBlank",Gt=!0),un[1].type="lineEnding",Pt=Kt}else if(!(un[1].type==="linePrefix"||un[1].type==="blockQuotePrefix"||un[1].type==="blockQuotePrefixWhitespace"||un[1].type==="blockQuoteMarker"||un[1].type==="listItemIndent"))break}Sn&&(!Pt||Sn<Pt)&&(jn._spread=!0),jn.end=Object.assign({},Pt?se[Pt][1].start:wt[1].end),se.splice(Pt||Te,0,["exit",jn,wt[2]]),Te++,Ee++}if(wt[1].type==="listItemPrefix"){const Kt={type:"listItem",_spread:!1,start:Object.assign({},wt[1].start),end:void 0};jn=Kt,se.splice(Te,0,["enter",Kt,wt[2]]),Te++,Ee++,Sn=void 0,Zt=!0}}}return se[he][1]._spread=Gt,Ee}function l(se,he){return Ee;function Ee(Te){c.call(this,se(Te),Te),he&&he.call(this,Te)}}function o(){this.stack.push({type:"fragment",children:[]})}function c(se,he,Ee){this.stack[this.stack.length-1].children.push(se),this.stack.push(se),this.tokenStack.push([he,Ee||void 0]),se.position={start:hi(he.start),end:void 0}}function f(se){return he;function he(Ee){se&&se.call(this,Ee),d.call(this,Ee)}}function d(se,he){const Ee=this.stack.pop(),Te=this.tokenStack.pop();if(Te)Te[0].type!==se.type&&(he?he.call(this,se,Te[0]):(Te[1]||jx).call(this,se,Te[0]));else throw new Error("Cannot close `"+se.type+"` ("+Fl({start:se.start,end:se.end})+"): it’s not open");Ee.position.end=hi(se.end)}function p(){return dm(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function m(se){if(this.data.expectingFirstListItemValue){const he=this.stack[this.stack.length-2];he.start=Number.parseInt(this.sliceSerialize(se),10),this.data.expectingFirstListItemValue=void 0}}function b(){const se=this.resume(),he=this.stack[this.stack.length-1];he.lang=se}function x(){const se=this.resume(),he=this.stack[this.stack.length-1];he.meta=se}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){const se=this.resume(),he=this.stack[this.stack.length-1];he.value=se.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const se=this.resume(),he=this.stack[this.stack.length-1];he.value=se.replace(/(\r?\n|\r)$/g,"")}function A(se){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=he,Ee.identifier=Gn(this.sliceSerialize(se)).toLowerCase()}function S(){const se=this.resume(),he=this.stack[this.stack.length-1];he.title=se}function O(){const se=this.resume(),he=this.stack[this.stack.length-1];he.url=se}function D(se){const he=this.stack[this.stack.length-1];if(!he.depth){const Ee=this.sliceSerialize(se).length;he.depth=Ee}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function F(se){const he=this.stack[this.stack.length-1];he.depth=this.sliceSerialize(se).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function U(se){const Ee=this.stack[this.stack.length-1].children;let Te=Ee[Ee.length-1];(!Te||Te.type!=="text")&&(Te=Ti(),Te.position={start:hi(se.start),end:void 0},Ee.push(Te)),this.stack.push(Te)}function j(se){const he=this.stack.pop();he.value+=this.sliceSerialize(se),he.position.end=hi(se.end)}function H(se){const he=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=he.children[he.children.length-1];Ee.position.end=hi(se.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(he.type)&&(U.call(this,se),j.call(this,se))}function B(){this.data.atHardBreak=!0}function q(){const se=this.resume(),he=this.stack[this.stack.length-1];he.value=se}function R(){const se=this.resume(),he=this.stack[this.stack.length-1];he.value=se}function $(){const se=this.resume(),he=this.stack[this.stack.length-1];he.value=se}function I(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=he,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function P(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=he,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function Y(se){const he=this.sliceSerialize(se),Ee=this.stack[this.stack.length-2];Ee.label=X4(he),Ee.identifier=Gn(he).toLowerCase()}function X(){const se=this.stack[this.stack.length-1],he=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const Te=se.children;Ee.children=Te}else Ee.alt=he}function E(){const se=this.resume(),he=this.stack[this.stack.length-1];he.url=se}function G(){const se=this.resume(),he=this.stack[this.stack.length-1];he.title=se}function te(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function V(se){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=he,Ee.identifier=Gn(this.sliceSerialize(se)).toLowerCase(),this.data.referenceType="full"}function K(se){this.data.characterReferenceType=se.type}function J(se){const he=this.sliceSerialize(se),Ee=this.data.characterReferenceType;let Te;Ee?(Te=rS(he,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Te=hm(he);const Qe=this.stack[this.stack.length-1];Qe.value+=Te}function le(se){const he=this.stack.pop();he.position.end=hi(se.end)}function fe(se){j.call(this,se);const he=this.stack[this.stack.length-1];he.url=this.sliceSerialize(se)}function ye(se){j.call(this,se);const he=this.stack[this.stack.length-1];he.url="mailto:"+this.sliceSerialize(se)}function Ae(){return{type:"blockquote",children:[]}}function Se(){return{type:"code",lang:null,meta:null,value:""}}function be(){return{type:"inlineCode",value:""}}function je(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ze(){return{type:"emphasis",children:[]}}function lt(){return{type:"heading",depth:0,children:[]}}function ft(){return{type:"break"}}function xt(){return{type:"html",value:""}}function Ai(){return{type:"image",title:null,url:"",alt:null}}function fr(){return{type:"link",title:null,url:"",children:[]}}function Dn(se){return{type:"list",ordered:se.type==="listOrdered",start:null,spread:se._spread,children:[]}}function Xn(se){return{type:"listItem",spread:se._spread,checked:null,children:[]}}function dr(){return{type:"paragraph",children:[]}}function Qn(){return{type:"strong",children:[]}}function Ti(){return{type:"text",value:""}}function Kn(){return{type:"thematicBreak"}}}function hi(e){return{line:e.line,column:e.column,offset:e.offset}}function pS(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?pS(e,r):W4(e,r)}}function W4(e,t){let n;for(n in t)if(hS.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function jx(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Fl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Fl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Fl({start:t.start,end:t.end})+") is still open")}function eR(e){const t=this;t.parser=n;function n(r){return K4(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function tR(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function nR(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
64
64
|
`}]}function rR(e,t){const n=t.value?t.value+`
|
|
65
|
-
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function iR(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aR(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sR(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=ws(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let o,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=l+1,c+=1,e.footnoteCounts.set(r,c);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,f);const d={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,d),e.applyData(t,d)}function lR(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oR(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function
|
|
65
|
+
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function iR(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aR(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sR(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=ws(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let o,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=l+1,c+=1,e.footnoteCounts.set(r,c);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,f);const d={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,d),e.applyData(t,d)}function lR(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oR(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function gS(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),l=s[0];l&&l.type==="text"?l.value="["+l.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=r:s.push({type:"text",value:r}),s}function uR(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return gS(e,t);const s={src:ws(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const l={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,l),e.applyData(t,l)}function cR(e,t){const n={src:ws(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function fR(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function dR(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return gS(e,t);const s={href:ws(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const l={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function hR(e,t){const n={href:ws(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function pR(e,t,n){const r=e.all(t),s=n?gR(n):mS(t),l={},o=[];if(typeof t.checked=="boolean"){const p=r[0];let g;p&&p.type==="element"&&p.tagName==="p"?g=p:(g={type:"element",tagName:"p",properties:{},children:[]},r.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const p=r[c];(s||c!==0||p.type!=="element"||p.tagName!=="p")&&o.push({type:"text",value:`
|
|
66
66
|
`}),p.type==="element"&&p.tagName==="p"&&!s?o.push(...p.children):o.push(p)}const f=r[r.length-1];f&&(s||f.type!=="element"||f.tagName!=="p")&&o.push({type:"text",value:`
|
|
67
|
-
`});const d={type:"element",tagName:"li",properties:l,children:o};return e.patch(t,d),e.applyData(t,d)}function gR(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=
|
|
67
|
+
`});const d={type:"element",tagName:"li",properties:l,children:o};return e.patch(t,d),e.applyData(t,d)}function gR(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=mS(n[r])}return t}function mS(e){const t=e.spread;return t??e.children.length>1}function mR(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const o=r[s];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function yR(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bR(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function vR(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xR(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),s.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=om(t.children[1]),f=X_(t.children[t.children.length-1]);c&&f&&(o.position={start:c,end:f}),s.push(o)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,l),e.applyData(t,l)}function wR(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,c=o?o.length:t.children.length;let f=-1;const d=[];for(;++f<c;){const g=t.children[f],m={},b=o?o[f]:void 0;b&&(m.align=b);let x={type:"element",tagName:l,properties:m,children:[]};g&&(x.children=e.all(g),e.patch(g,x),x=e.applyData(g,x)),d.push(x)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,p),e.applyData(t,p)}function _R(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const zx=9,Lx=32;function SR(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const l=[];for(;r;)l.push(Ix(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return l.push(Ix(t.slice(s),s>0,!1)),l.join("")}function Ix(e,t,n){let r=0,s=e.length;if(t){let l=e.codePointAt(r);for(;l===zx||l===Lx;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(s-1);for(;l===zx||l===Lx;)s--,l=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function kR(e,t){const n={type:"text",value:SR(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function ER(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const AR={blockquote:tR,break:nR,code:rR,delete:iR,emphasis:aR,footnoteReference:sR,heading:lR,html:oR,imageReference:uR,image:cR,inlineCode:fR,linkReference:dR,link:hR,listItem:pR,list:mR,paragraph:yR,root:bR,strong:vR,table:xR,tableCell:_R,tableRow:wR,text:kR,thematicBreak:ER,toml:Uu,yaml:Uu,definition:Uu,footnoteDefinition:Uu};function Uu(){}const yS=-1,Hc=0,Ul=1,vc=2,gm=3,mm=4,ym=5,bm=6,bS=7,vS=8,Bx=typeof self=="object"?self:globalThis,TR=(e,t)=>{const n=(s,l)=>(e.set(l,s),s),r=s=>{if(e.has(s))return e.get(s);const[l,o]=t[s];switch(l){case Hc:case yS:return n(o,s);case Ul:{const c=n([],s);for(const f of o)c.push(r(f));return c}case vc:{const c=n({},s);for(const[f,d]of o)c[r(f)]=r(d);return c}case gm:return n(new Date(o),s);case mm:{const{source:c,flags:f}=o;return n(new RegExp(c,f),s)}case ym:{const c=n(new Map,s);for(const[f,d]of o)c.set(r(f),r(d));return c}case bm:{const c=n(new Set,s);for(const f of o)c.add(r(f));return c}case bS:{const{name:c,message:f}=o;return n(new Bx[c](f),s)}case vS:return n(BigInt(o),s);case"BigInt":return n(Object(BigInt(o)),s);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:c}=new Uint8Array(o);return n(new DataView(c),o)}}return n(new Bx[l](o),s)};return r},Fx=e=>TR(new Map,e)(0),Xa="",{toString:NR}={},{keys:CR}=Object,Rl=e=>{const t=typeof e;if(t!=="object"||!e)return[Hc,t];const n=NR.call(e).slice(8,-1);switch(n){case"Array":return[Ul,Xa];case"Object":return[vc,Xa];case"Date":return[gm,Xa];case"RegExp":return[mm,Xa];case"Map":return[ym,Xa];case"Set":return[bm,Xa];case"DataView":return[Ul,n]}return n.includes("Array")?[Ul,n]:n.includes("Error")?[bS,n]:[vc,n]},Hu=([e,t])=>e===Hc&&(t==="function"||t==="symbol"),OR=(e,t,n,r)=>{const s=(o,c)=>{const f=r.push(o)-1;return n.set(c,f),f},l=o=>{if(n.has(o))return n.get(o);let[c,f]=Rl(o);switch(c){case Hc:{let p=o;switch(f){case"bigint":c=vS,p=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);p=null;break;case"undefined":return s([yS],o)}return s([c,p],o)}case Ul:{if(f){let m=o;return f==="DataView"?m=new Uint8Array(o.buffer):f==="ArrayBuffer"&&(m=new Uint8Array(o)),s([f,[...m]],o)}const p=[],g=s([c,p],o);for(const m of o)p.push(l(m));return g}case vc:{if(f)switch(f){case"BigInt":return s([f,o.toString()],o);case"Boolean":case"Number":case"String":return s([f,o.valueOf()],o)}if(t&&"toJSON"in o)return l(o.toJSON());const p=[],g=s([c,p],o);for(const m of CR(o))(e||!Hu(Rl(o[m])))&&p.push([l(m),l(o[m])]);return g}case gm:return s([c,o.toISOString()],o);case mm:{const{source:p,flags:g}=o;return s([c,{source:p,flags:g}],o)}case ym:{const p=[],g=s([c,p],o);for(const[m,b]of o)(e||!(Hu(Rl(m))||Hu(Rl(b))))&&p.push([l(m),l(b)]);return g}case bm:{const p=[],g=s([c,p],o);for(const m of o)(e||!Hu(Rl(m)))&&p.push(l(m));return g}}const{message:d}=o;return s([c,{name:f,message:d}],o)};return l},Px=(e,{json:t,lossy:n}={})=>{const r=[];return OR(!(t||n),!!t,new Map,r)(e),r},xc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Fx(Px(e,t)):structuredClone(e):(e,t)=>Fx(Px(e,t));function MR(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function RR(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function DR(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||MR,r=e.options.footnoteBackLabel||RR,s=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let f=-1;for(;++f<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[f]);if(!d)continue;const p=e.all(d),g=String(d.identifier).toUpperCase(),m=ws(g.toLowerCase());let b=0;const x=[],w=e.footnoteCounts.get(g);for(;w!==void 0&&++b<=w;){x.length>0&&x.push({type:"text",value:" "});let A=typeof n=="string"?n:n(f,b);typeof A=="string"&&(A={type:"text",value:A}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,b),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const _=p[p.length-1];if(_&&_.type==="element"&&_.tagName==="p"){const A=_.children[_.children.length-1];A&&A.type==="text"?A.value+=" ":_.children.push({type:"text",value:" "}),_.children.push(...x)}else p.push(...x);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(p,!0)};e.patch(d,k),c.push(k)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...xc(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
68
68
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
69
|
-
`}]}}const $c=function(e){if(e==null)return IR;if(typeof e=="function")return Vc(e);if(typeof e=="object")return Array.isArray(e)?jR(e):zR(e);if(typeof e=="string")return LR(e);throw new Error("Expected function, string, or object as test")};function jR(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=$c(e[n]);return Vc(r);function r(...s){let l=-1;for(;++l<t.length;)if(t[l].apply(this,s))return!0;return!1}}function zR(e){const t=e;return Vc(n);function n(r){const s=r;let l;for(l in e)if(s[l]!==t[l])return!1;return!0}}function LR(e){return Vc(t);function t(n){return n&&n.type===e}}function Vc(e){return t;function t(n,r,s){return!!(BR(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function IR(){return!0}function BR(e){return e!==null&&typeof e=="object"&&"type"in e}const
|
|
69
|
+
`}]}}const $c=function(e){if(e==null)return IR;if(typeof e=="function")return Vc(e);if(typeof e=="object")return Array.isArray(e)?jR(e):zR(e);if(typeof e=="string")return LR(e);throw new Error("Expected function, string, or object as test")};function jR(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=$c(e[n]);return Vc(r);function r(...s){let l=-1;for(;++l<t.length;)if(t[l].apply(this,s))return!0;return!1}}function zR(e){const t=e;return Vc(n);function n(r){const s=r;let l;for(l in e)if(s[l]!==t[l])return!1;return!0}}function LR(e){return Vc(t);function t(n){return n&&n.type===e}}function Vc(e){return t;function t(n,r,s){return!!(BR(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function IR(){return!0}function BR(e){return e!==null&&typeof e=="object"&&"type"in e}const xS=[],FR=!0,Cg=!1,PR="skip";function wS(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const l=$c(s),o=r?-1:1;c(e,void 0,[])();function c(f,d,p){const g=f&&typeof f=="object"?f:{};if(typeof g.type=="string"){const b=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(f.type+(b?"<"+b+">":""))+")"})}return m;function m(){let b=xS,x,w,_;if((!t||l(f,d,p[p.length-1]||void 0))&&(b=UR(n(f,p)),b[0]===Cg))return b;if("children"in f&&f.children){const k=f;if(k.children&&b[0]!==PR)for(w=(r?k.children.length:-1)+o,_=p.concat(k);w>-1&&w<k.children.length;){const A=k.children[w];if(x=c(A,w,_)(),x[0]===Cg)return x;w=typeof x[1]=="number"?x[1]:w+o}}return b}}}function UR(e){return Array.isArray(e)?e:typeof e=="number"?[FR,e]:e==null?xS:[e]}function vm(e,t,n,r){let s,l,o;typeof t=="function"&&typeof n!="function"?(l=void 0,o=t,s=n):(l=t,o=n,s=r),wS(e,l,c,s);function c(f,d){const p=d[d.length-1],g=p?p.children.indexOf(f):void 0;return o(f,g,p)}}const Og={}.hasOwnProperty,HR={};function $R(e,t){const n=t||HR,r=new Map,s=new Map,l=new Map,o={...AR,...n.handlers},c={all:d,applyData:qR,definitionById:r,footnoteById:s,footnoteCounts:l,footnoteOrder:[],handlers:o,one:f,options:n,patch:VR,wrap:ZR};return vm(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const g=p.type==="definition"?r:s,m=String(p.identifier).toUpperCase();g.has(m)||g.set(m,p)}}),c;function f(p,g){const m=p.type,b=c.handlers[m];if(Og.call(c.handlers,m)&&b)return b(c,p,g);if(c.options.passThrough&&c.options.passThrough.includes(m)){if("children"in p){const{children:w,..._}=p,k=xc(_);return k.children=c.all(p),k}return xc(p)}return(c.options.unknownHandler||GR)(c,p,g)}function d(p){const g=[];if("children"in p){const m=p.children;let b=-1;for(;++b<m.length;){const x=c.one(m[b],p);if(x){if(b&&m[b-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=Ux(x.value)),!Array.isArray(x)&&x.type==="element")){const w=x.children[0];w&&w.type==="text"&&(w.value=Ux(w.value))}Array.isArray(x)?g.push(...x):g.push(x)}}}return g}}function VR(e,t){e.position&&(t.position=RO(e))}function qR(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&l&&Object.assign(n.properties,xc(l)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function GR(e,t){const n=t.data||{},r="value"in t&&!(Og.call(n,"hProperties")||Og.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ZR(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
70
70
|
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
71
71
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
72
|
-
`}),n}function
|
|
73
|
-
`},s),l}function YR(e,t){return e&&"run"in e?async function(n,r){const s=Ux(n,{file:r,...t});await e.run(s,r)}:function(n,r){return Ux(n,{file:r,...e||t})}}function Hx(e){if(e)throw e}var Hh,$x;function XR(){if($x)return Hh;$x=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},l=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var p=e.call(d,"constructor"),g=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!g)return!1;var m;for(m in d);return typeof m>"u"||e.call(d,m)},o=function(d,p){n&&p.name==="__proto__"?n(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},c=function(d,p){if(p==="__proto__")if(e.call(d,p)){if(r)return r(d,p).value}else return;return d[p]};return Hh=function f(){var d,p,g,m,b,x,w=arguments[0],_=1,k=arguments.length,A=!1;for(typeof w=="boolean"&&(A=w,w=arguments[1]||{},_=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});_<k;++_)if(d=arguments[_],d!=null)for(p in d)g=c(w,p),m=c(d,p),w!==m&&(A&&m&&(l(m)||(b=s(m)))?(b?(b=!1,x=g&&s(g)?g:[]):x=g&&l(g)?g:{},o(w,{name:p,newValue:f(A,x,m)})):typeof m<"u"&&o(w,{name:p,newValue:m}));return w},Hh}var QR=XR();const $h=ki(QR);function Mg(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function KR(){const e=[],t={run:n,use:r};return t;function n(...s){let l=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);c(null,...s);function c(f,...d){const p=e[++l];let g=-1;if(f){o(f);return}for(;++g<s.length;)(d[g]===null||d[g]===void 0)&&(d[g]=s[g]);s=d,p?JR(p,c)(...d):o(null,...d)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function JR(e,t){let n;return r;function r(...o){const c=e.length>o.length;let f;c&&o.push(s);try{f=e.apply(this,o)}catch(d){const p=d;if(c&&n)throw p;return s(p)}c||(f&&f.then&&typeof f.then=="function"?f.then(l,s):f instanceof Error?s(f):l(f))}function s(o,...c){n||(n=!0,t(o,...c))}function l(o){s(null,o)}}const ir={basename:WR,dirname:eD,extname:tD,join:nD,sep:"/"};function WR(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');uo(e);let n=0,r=-1,s=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(l){n=s+1;break}}else r<0&&(l=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,c=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(l){n=s+1;break}}else o<0&&(l=!0,o=s+1),c>-1&&(e.codePointAt(s)===t.codePointAt(c--)?c<0&&(r=s):(c=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function eD(e){if(uo(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function tD(e){uo(e);let t=e.length,n=-1,r=0,s=-1,l=0,o;for(;t--;){const c=e.codePointAt(t);if(c===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),c===46?s<0?s=t:l!==1&&(l=1):s>-1&&(l=-1)}return s<0||n<0||l===0||l===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function nD(...e){let t=-1,n;for(;++t<e.length;)uo(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":rD(n)}function rD(e){uo(e);const t=e.codePointAt(0)===47;let n=iD(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function iD(e,t){let n="",r=0,s=-1,l=0,o=-1,c,f;for(;++o<=e.length;){if(o<e.length)c=e.codePointAt(o);else{if(c===47)break;c=47}if(c===47){if(!(s===o-1||l===1))if(s!==o-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),s=o,l=0;continue}}else if(n.length>0){n="",r=0,s=o,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),r=o-s-1;s=o,l=0}else c===46&&l>-1?l++:l=-1}return n}function uo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const aD={cwd:sD};function sD(){return"/"}function Rg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function lD(e){if(typeof e=="string")e=new URL(e);else if(!Rg(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return oD(e)}function oD(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Vh=["history","path","basename","stem","extname","dirname"];class wS{constructor(t){let n;t?Rg(t)?n={path:t}:typeof t=="string"||uD(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":aD.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Vh.length;){const l=Vh[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let s;for(s in n)Vh.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?ir.basename(this.path):void 0}set basename(t){Gh(t,"basename"),qh(t,"basename"),this.path=ir.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ir.dirname(this.path):void 0}set dirname(t){Vx(this.basename,"dirname"),this.path=ir.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ir.extname(this.path):void 0}set extname(t){if(qh(t,"extname"),Vx(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ir.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Rg(t)&&(t=lD(t)),Gh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ir.basename(this.path,this.extname):void 0}set stem(t){Gh(t,"stem"),qh(t,"stem"),this.path=ir.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new qt(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function qh(e,t){if(e&&e.includes(ir.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ir.sep+"`")}function Gh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Vx(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function uD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const cD=function(e){const r=this.constructor.prototype,s=r[e],l=function(){return s.apply(l,arguments)};return Object.setPrototypeOf(l,r),l},fD={}.hasOwnProperty;class xm extends cD{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=KR()}copy(){const t=new xm;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data($h(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Xh("data",this.frozen),this.namespace[t]=n,this):fD.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Xh("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=$u(t),r=this.parser||this.Parser;return Zh("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Zh("process",this.parser||this.Parser),Yh("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(l,o){const c=$u(t),f=r.parse(c);r.run(f,c,function(p,g,m){if(p||!g||!m)return d(p);const b=g,x=r.stringify(b,m);pD(x)?m.value=x:m.result=x,d(p,m)});function d(p,g){p||!g?o(p):l?l(g):n(void 0,g)}}}processSync(t){let n=!1,r;return this.freeze(),Zh("processSync",this.parser||this.Parser),Yh("processSync",this.compiler||this.Compiler),this.process(t,s),Gx("processSync","process",n),r;function s(l,o){n=!0,Hx(l),r=o}}run(t,n,r){qx(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(o,c){const f=$u(n);s.run(t,f,d);function d(p,g,m){const b=g||t;p?c(p):o?o(b):r(void 0,b,m)}}}runSync(t,n){let r=!1,s;return this.run(t,n,l),Gx("runSync","run",r),s;function l(o,c){Hx(o),s=c,r=!0}}stringify(t,n){this.freeze();const r=$u(n),s=this.compiler||this.Compiler;return Yh("stringify",s),qx(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Xh("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(d){if(typeof d=="function")f(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[p,...g]=d;f(p,g)}else o(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function o(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(d.plugins),d.settings&&(s.settings=$h(!0,s.settings,d.settings))}function c(d){let p=-1;if(d!=null)if(Array.isArray(d))for(;++p<d.length;){const g=d[p];l(g)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function f(d,p){let g=-1,m=-1;for(;++g<r.length;)if(r[g][0]===d){m=g;break}if(m===-1)r.push([d,...p]);else if(p.length>0){let[b,...x]=p;const w=r[m][1];Mg(w)&&Mg(b)&&(b=$h(!0,w,b)),r[m]=[d,b,...x]}}}}const dD=new xm().freeze();function Zh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Yh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Xh(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function qx(e){if(!Mg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Gx(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function $u(e){return hD(e)?e:new wS(e)}function hD(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function pD(e){return typeof e=="string"||gD(e)}function gD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mD="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Zx=[],Yx={allowDangerousHtml:!0},yD=/^(https?|ircs?|mailto|xmpp)$/i,bD=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function _S(e){const t=vD(e),n=xD(e);return wD(t.runSync(t.parse(n),n),e)}function vD(e){const t=e.rehypePlugins||Zx,n=e.remarkPlugins||Zx,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Yx}:Yx;return dD().use(eR).use(n).use(YR,r).use(t)}function xD(e){const t=e.children||"",n=new wS;return typeof t=="string"&&(n.value=t),n}function wD(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,l=t.disallowedElements,o=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||_D;for(const p of bD)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+mD+p.id,void 0);return vm(e,d),IO(e,{Fragment:C.Fragment,components:s,ignoreInvalidStyle:!0,jsx:C.jsx,jsxs:C.jsxs,passKeys:!0,passNode:!0});function d(p,g,m){if(p.type==="raw"&&m&&typeof g=="number")return o?m.children.splice(g,1):m.children[g]={type:"text",value:p.value},g;if(p.type==="element"){let b;for(b in Fh)if(Object.hasOwn(Fh,b)&&Object.hasOwn(p.properties,b)){const x=p.properties[b],w=Fh[b];(w===null||w.includes(p.tagName))&&(p.properties[b]=f(String(x||""),b,p))}}if(p.type==="element"){let b=n?!n.includes(p.tagName):l?l.includes(p.tagName):!1;if(!b&&r&&typeof g=="number"&&(b=!r(p,g,m)),b&&m&&typeof g=="number")return c&&p.children?m.children.splice(g,1,...p.children):m.children.splice(g,1),g}}}function _D(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||yD.test(e.slice(0,t))?e:""}function Xx(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function SD(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function kD(e,t,n){const s=$c((n||{}).ignore||[]),l=ED(t);let o=-1;for(;++o<l.length;)xS(e,"text",c);function c(d,p){let g=-1,m;for(;++g<p.length;){const b=p[g],x=m?m.children:void 0;if(s(b,x?x.indexOf(b):void 0,m))return;m=b}if(m)return f(d,p)}function f(d,p){const g=p[p.length-1],m=l[o][0],b=l[o][1];let x=0;const _=g.children.indexOf(d);let k=!1,A=[];m.lastIndex=0;let S=m.exec(d.value);for(;S;){const O=S.index,D={index:S.index,input:S.input,stack:[...p,d]};let M=b(...S,D);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?m.lastIndex=O+1:(x!==O&&A.push({type:"text",value:d.value.slice(x,O)}),Array.isArray(M)?A.push(...M):M&&A.push(M),x=O+S[0].length,k=!0),!m.global)break;S=m.exec(d.value)}return k?(x<d.value.length&&A.push({type:"text",value:d.value.slice(x)}),g.children.splice(_,1,...A)):A=[d],_+A.length}}function ED(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const s=n[r];t.push([AD(s[0]),TD(s[1])])}return t}function AD(e){return typeof e=="string"?new RegExp(SD(e),"g"):e}function TD(e){return typeof e=="function"?e:function(){return e}}const Qh="phrasing",Kh=["autolink","link","image","label"];function CD(){return{transforms:[zD],enter:{literalAutolink:OD,literalAutolinkEmail:Jh,literalAutolinkHttp:Jh,literalAutolinkWww:Jh},exit:{literalAutolink:jD,literalAutolinkEmail:DD,literalAutolinkHttp:MD,literalAutolinkWww:RD}}}function ND(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Qh,notInConstruct:Kh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Qh,notInConstruct:Kh},{character:":",before:"[ps]",after:"\\/",inConstruct:Qh,notInConstruct:Kh}]}}function OD(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Jh(e){this.config.enter.autolinkProtocol.call(this,e)}function MD(e){this.config.exit.autolinkProtocol.call(this,e)}function RD(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function DD(e){this.config.exit.autolinkEmail.call(this,e)}function jD(e){this.exit(e)}function zD(e){kD(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,LD],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),ID]],{ignore:["link","linkReference"]})}function LD(e,t,n,r,s){let l="";if(!SS(s)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!BD(n)))return!1;const o=FD(n+r);if(!o[0])return!1;const c={type:"link",title:null,url:l+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[c,{type:"text",value:o[1]}]:c}function ID(e,t,n,r){return!SS(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function BD(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function FD(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=Xx(e,"(");let l=Xx(e,")");for(;r!==-1&&s>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function SS(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ia(n)||Pc(n))&&(!t||n!==47)}kS.peek=YD;function PD(){this.buffer()}function UD(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function HD(){this.buffer()}function $D(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function VD(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Gn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qD(e){this.exit(e)}function GD(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Gn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ZD(e){this.exit(e)}function YD(){return"["}function kS(e,t,n,r){const s=n.createTracker(r);let l=s.move("[^");const o=n.enter("footnoteReference"),c=n.enter("reference");return l+=s.move(n.safe(n.associationId(e),{after:"]",before:l})),c(),o(),l+=s.move("]"),l}function XD(){return{enter:{gfmFootnoteCallString:PD,gfmFootnoteCall:UD,gfmFootnoteDefinitionLabelString:HD,gfmFootnoteDefinition:$D},exit:{gfmFootnoteCallString:VD,gfmFootnoteCall:qD,gfmFootnoteDefinitionLabelString:GD,gfmFootnoteDefinition:ZD}}}function QD(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:kS},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,l,o){const c=l.createTracker(o);let f=c.move("[^");const d=l.enter("footnoteDefinition"),p=l.enter("label");return f+=c.move(l.safe(l.associationId(r),{before:f,after:"]"})),p(),f+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),f+=c.move((t?`
|
|
74
|
-
`:" ")+l.indentLines(l.containerFlow(r,c.current()),t?
|
|
75
|
-
`)}function sj(e){return e==null?"":String(e)}function
|
|
72
|
+
`}),n}function Ux(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Hx(e,t){const n=$R(e,t),r=n.one(e,void 0),s=DR(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&l.children.push({type:"text",value:`
|
|
73
|
+
`},s),l}function YR(e,t){return e&&"run"in e?async function(n,r){const s=Hx(n,{file:r,...t});await e.run(s,r)}:function(n,r){return Hx(n,{file:r,...e||t})}}function $x(e){if(e)throw e}var Hh,Vx;function XR(){if(Vx)return Hh;Vx=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},l=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var p=e.call(d,"constructor"),g=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!g)return!1;var m;for(m in d);return typeof m>"u"||e.call(d,m)},o=function(d,p){n&&p.name==="__proto__"?n(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},c=function(d,p){if(p==="__proto__")if(e.call(d,p)){if(r)return r(d,p).value}else return;return d[p]};return Hh=function f(){var d,p,g,m,b,x,w=arguments[0],_=1,k=arguments.length,A=!1;for(typeof w=="boolean"&&(A=w,w=arguments[1]||{},_=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});_<k;++_)if(d=arguments[_],d!=null)for(p in d)g=c(w,p),m=c(d,p),w!==m&&(A&&m&&(l(m)||(b=s(m)))?(b?(b=!1,x=g&&s(g)?g:[]):x=g&&l(g)?g:{},o(w,{name:p,newValue:f(A,x,m)})):typeof m<"u"&&o(w,{name:p,newValue:m}));return w},Hh}var QR=XR();const $h=ki(QR);function Mg(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function KR(){const e=[],t={run:n,use:r};return t;function n(...s){let l=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);c(null,...s);function c(f,...d){const p=e[++l];let g=-1;if(f){o(f);return}for(;++g<s.length;)(d[g]===null||d[g]===void 0)&&(d[g]=s[g]);s=d,p?JR(p,c)(...d):o(null,...d)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function JR(e,t){let n;return r;function r(...o){const c=e.length>o.length;let f;c&&o.push(s);try{f=e.apply(this,o)}catch(d){const p=d;if(c&&n)throw p;return s(p)}c||(f&&f.then&&typeof f.then=="function"?f.then(l,s):f instanceof Error?s(f):l(f))}function s(o,...c){n||(n=!0,t(o,...c))}function l(o){s(null,o)}}const ir={basename:WR,dirname:eD,extname:tD,join:nD,sep:"/"};function WR(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');uo(e);let n=0,r=-1,s=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(l){n=s+1;break}}else r<0&&(l=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,c=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(l){n=s+1;break}}else o<0&&(l=!0,o=s+1),c>-1&&(e.codePointAt(s)===t.codePointAt(c--)?c<0&&(r=s):(c=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function eD(e){if(uo(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function tD(e){uo(e);let t=e.length,n=-1,r=0,s=-1,l=0,o;for(;t--;){const c=e.codePointAt(t);if(c===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),c===46?s<0?s=t:l!==1&&(l=1):s>-1&&(l=-1)}return s<0||n<0||l===0||l===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function nD(...e){let t=-1,n;for(;++t<e.length;)uo(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":rD(n)}function rD(e){uo(e);const t=e.codePointAt(0)===47;let n=iD(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function iD(e,t){let n="",r=0,s=-1,l=0,o=-1,c,f;for(;++o<=e.length;){if(o<e.length)c=e.codePointAt(o);else{if(c===47)break;c=47}if(c===47){if(!(s===o-1||l===1))if(s!==o-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),s=o,l=0;continue}}else if(n.length>0){n="",r=0,s=o,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),r=o-s-1;s=o,l=0}else c===46&&l>-1?l++:l=-1}return n}function uo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const aD={cwd:sD};function sD(){return"/"}function Rg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function lD(e){if(typeof e=="string")e=new URL(e);else if(!Rg(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return oD(e)}function oD(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Vh=["history","path","basename","stem","extname","dirname"];class _S{constructor(t){let n;t?Rg(t)?n={path:t}:typeof t=="string"||uD(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":aD.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Vh.length;){const l=Vh[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let s;for(s in n)Vh.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?ir.basename(this.path):void 0}set basename(t){Gh(t,"basename"),qh(t,"basename"),this.path=ir.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ir.dirname(this.path):void 0}set dirname(t){qx(this.basename,"dirname"),this.path=ir.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ir.extname(this.path):void 0}set extname(t){if(qh(t,"extname"),qx(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ir.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Rg(t)&&(t=lD(t)),Gh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ir.basename(this.path,this.extname):void 0}set stem(t){Gh(t,"stem"),qh(t,"stem"),this.path=ir.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new qt(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function qh(e,t){if(e&&e.includes(ir.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ir.sep+"`")}function Gh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function qx(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function uD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const cD=function(e){const r=this.constructor.prototype,s=r[e],l=function(){return s.apply(l,arguments)};return Object.setPrototypeOf(l,r),l},fD={}.hasOwnProperty;class xm extends cD{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=KR()}copy(){const t=new xm;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data($h(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Xh("data",this.frozen),this.namespace[t]=n,this):fD.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Xh("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=$u(t),r=this.parser||this.Parser;return Zh("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Zh("process",this.parser||this.Parser),Yh("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(l,o){const c=$u(t),f=r.parse(c);r.run(f,c,function(p,g,m){if(p||!g||!m)return d(p);const b=g,x=r.stringify(b,m);pD(x)?m.value=x:m.result=x,d(p,m)});function d(p,g){p||!g?o(p):l?l(g):n(void 0,g)}}}processSync(t){let n=!1,r;return this.freeze(),Zh("processSync",this.parser||this.Parser),Yh("processSync",this.compiler||this.Compiler),this.process(t,s),Zx("processSync","process",n),r;function s(l,o){n=!0,$x(l),r=o}}run(t,n,r){Gx(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(o,c){const f=$u(n);s.run(t,f,d);function d(p,g,m){const b=g||t;p?c(p):o?o(b):r(void 0,b,m)}}}runSync(t,n){let r=!1,s;return this.run(t,n,l),Zx("runSync","run",r),s;function l(o,c){$x(o),s=c,r=!0}}stringify(t,n){this.freeze();const r=$u(n),s=this.compiler||this.Compiler;return Yh("stringify",s),Gx(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Xh("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(d){if(typeof d=="function")f(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[p,...g]=d;f(p,g)}else o(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function o(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(d.plugins),d.settings&&(s.settings=$h(!0,s.settings,d.settings))}function c(d){let p=-1;if(d!=null)if(Array.isArray(d))for(;++p<d.length;){const g=d[p];l(g)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function f(d,p){let g=-1,m=-1;for(;++g<r.length;)if(r[g][0]===d){m=g;break}if(m===-1)r.push([d,...p]);else if(p.length>0){let[b,...x]=p;const w=r[m][1];Mg(w)&&Mg(b)&&(b=$h(!0,w,b)),r[m]=[d,b,...x]}}}}const dD=new xm().freeze();function Zh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Yh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Xh(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Gx(e){if(!Mg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Zx(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function $u(e){return hD(e)?e:new _S(e)}function hD(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function pD(e){return typeof e=="string"||gD(e)}function gD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mD="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Yx=[],Xx={allowDangerousHtml:!0},yD=/^(https?|ircs?|mailto|xmpp)$/i,bD=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function SS(e){const t=vD(e),n=xD(e);return wD(t.runSync(t.parse(n),n),e)}function vD(e){const t=e.rehypePlugins||Yx,n=e.remarkPlugins||Yx,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Xx}:Xx;return dD().use(eR).use(n).use(YR,r).use(t)}function xD(e){const t=e.children||"",n=new _S;return typeof t=="string"&&(n.value=t),n}function wD(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,l=t.disallowedElements,o=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||_D;for(const p of bD)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+mD+p.id,void 0);return vm(e,d),IO(e,{Fragment:N.Fragment,components:s,ignoreInvalidStyle:!0,jsx:N.jsx,jsxs:N.jsxs,passKeys:!0,passNode:!0});function d(p,g,m){if(p.type==="raw"&&m&&typeof g=="number")return o?m.children.splice(g,1):m.children[g]={type:"text",value:p.value},g;if(p.type==="element"){let b;for(b in Fh)if(Object.hasOwn(Fh,b)&&Object.hasOwn(p.properties,b)){const x=p.properties[b],w=Fh[b];(w===null||w.includes(p.tagName))&&(p.properties[b]=f(String(x||""),b,p))}}if(p.type==="element"){let b=n?!n.includes(p.tagName):l?l.includes(p.tagName):!1;if(!b&&r&&typeof g=="number"&&(b=!r(p,g,m)),b&&m&&typeof g=="number")return c&&p.children?m.children.splice(g,1,...p.children):m.children.splice(g,1),g}}}function _D(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||yD.test(e.slice(0,t))?e:""}function Qx(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function SD(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function kD(e,t,n){const s=$c((n||{}).ignore||[]),l=ED(t);let o=-1;for(;++o<l.length;)wS(e,"text",c);function c(d,p){let g=-1,m;for(;++g<p.length;){const b=p[g],x=m?m.children:void 0;if(s(b,x?x.indexOf(b):void 0,m))return;m=b}if(m)return f(d,p)}function f(d,p){const g=p[p.length-1],m=l[o][0],b=l[o][1];let x=0;const _=g.children.indexOf(d);let k=!1,A=[];m.lastIndex=0;let S=m.exec(d.value);for(;S;){const O=S.index,D={index:S.index,input:S.input,stack:[...p,d]};let M=b(...S,D);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?m.lastIndex=O+1:(x!==O&&A.push({type:"text",value:d.value.slice(x,O)}),Array.isArray(M)?A.push(...M):M&&A.push(M),x=O+S[0].length,k=!0),!m.global)break;S=m.exec(d.value)}return k?(x<d.value.length&&A.push({type:"text",value:d.value.slice(x)}),g.children.splice(_,1,...A)):A=[d],_+A.length}}function ED(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const s=n[r];t.push([AD(s[0]),TD(s[1])])}return t}function AD(e){return typeof e=="string"?new RegExp(SD(e),"g"):e}function TD(e){return typeof e=="function"?e:function(){return e}}const Qh="phrasing",Kh=["autolink","link","image","label"];function ND(){return{transforms:[zD],enter:{literalAutolink:OD,literalAutolinkEmail:Jh,literalAutolinkHttp:Jh,literalAutolinkWww:Jh},exit:{literalAutolink:jD,literalAutolinkEmail:DD,literalAutolinkHttp:MD,literalAutolinkWww:RD}}}function CD(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Qh,notInConstruct:Kh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Qh,notInConstruct:Kh},{character:":",before:"[ps]",after:"\\/",inConstruct:Qh,notInConstruct:Kh}]}}function OD(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Jh(e){this.config.enter.autolinkProtocol.call(this,e)}function MD(e){this.config.exit.autolinkProtocol.call(this,e)}function RD(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function DD(e){this.config.exit.autolinkEmail.call(this,e)}function jD(e){this.exit(e)}function zD(e){kD(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,LD],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),ID]],{ignore:["link","linkReference"]})}function LD(e,t,n,r,s){let l="";if(!kS(s)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!BD(n)))return!1;const o=FD(n+r);if(!o[0])return!1;const c={type:"link",title:null,url:l+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[c,{type:"text",value:o[1]}]:c}function ID(e,t,n,r){return!kS(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function BD(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function FD(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=Qx(e,"(");let l=Qx(e,")");for(;r!==-1&&s>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function kS(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ia(n)||Pc(n))&&(!t||n!==47)}ES.peek=YD;function PD(){this.buffer()}function UD(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function HD(){this.buffer()}function $D(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function VD(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Gn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qD(e){this.exit(e)}function GD(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Gn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ZD(e){this.exit(e)}function YD(){return"["}function ES(e,t,n,r){const s=n.createTracker(r);let l=s.move("[^");const o=n.enter("footnoteReference"),c=n.enter("reference");return l+=s.move(n.safe(n.associationId(e),{after:"]",before:l})),c(),o(),l+=s.move("]"),l}function XD(){return{enter:{gfmFootnoteCallString:PD,gfmFootnoteCall:UD,gfmFootnoteDefinitionLabelString:HD,gfmFootnoteDefinition:$D},exit:{gfmFootnoteCallString:VD,gfmFootnoteCall:qD,gfmFootnoteDefinitionLabelString:GD,gfmFootnoteDefinition:ZD}}}function QD(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:ES},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,l,o){const c=l.createTracker(o);let f=c.move("[^");const d=l.enter("footnoteDefinition"),p=l.enter("label");return f+=c.move(l.safe(l.associationId(r),{before:f,after:"]"})),p(),f+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),f+=c.move((t?`
|
|
74
|
+
`:" ")+l.indentLines(l.containerFlow(r,c.current()),t?AS:KD))),d(),f}}function KD(e,t,n){return t===0?e:AS(e,t,n)}function AS(e,t,n){return(n?"":" ")+e}const JD=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];TS.peek=rj;function WD(){return{canContainEols:["delete"],enter:{strikethrough:tj},exit:{strikethrough:nj}}}function ej(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:JD}],handlers:{delete:TS}}}function tj(e){this.enter({type:"delete",children:[]},e)}function nj(e){this.exit(e)}function TS(e,t,n,r){const s=n.createTracker(r),l=n.enter("strikethrough");let o=s.move("~~");return o+=n.containerPhrasing(e,{...s.current(),before:o,after:"~"}),o+=s.move("~~"),l(),o}function rj(){return"~"}function ij(e){return e.length}function aj(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||ij,l=[],o=[],c=[],f=[];let d=0,p=-1;for(;++p<e.length;){const w=[],_=[];let k=-1;for(e[p].length>d&&(d=e[p].length);++k<e[p].length;){const A=sj(e[p][k]);if(n.alignDelimiters!==!1){const S=s(A);_[k]=S,(f[k]===void 0||S>f[k])&&(f[k]=S)}w.push(A)}o[p]=w,c[p]=_}let g=-1;if(typeof r=="object"&&"length"in r)for(;++g<d;)l[g]=Kx(r[g]);else{const w=Kx(r);for(;++g<d;)l[g]=w}g=-1;const m=[],b=[];for(;++g<d;){const w=l[g];let _="",k="";w===99?(_=":",k=":"):w===108?_=":":w===114&&(k=":");let A=n.alignDelimiters===!1?1:Math.max(1,f[g]-_.length-k.length);const S=_+"-".repeat(A)+k;n.alignDelimiters!==!1&&(A=_.length+A+k.length,A>f[g]&&(f[g]=A),b[g]=A),m[g]=S}o.splice(1,0,m),c.splice(1,0,b),p=-1;const x=[];for(;++p<o.length;){const w=o[p],_=c[p];g=-1;const k=[];for(;++g<d;){const A=w[g]||"";let S="",O="";if(n.alignDelimiters!==!1){const D=f[g]-(_[g]||0),M=l[g];M===114?S=" ".repeat(D):M===99?D%2?(S=" ".repeat(D/2+.5),O=" ".repeat(D/2-.5)):(S=" ".repeat(D/2),O=S):O=" ".repeat(D)}n.delimiterStart!==!1&&!g&&k.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&A==="")&&(n.delimiterStart!==!1||g)&&k.push(" "),n.alignDelimiters!==!1&&k.push(S),k.push(A),n.alignDelimiters!==!1&&k.push(O),n.padding!==!1&&k.push(" "),(n.delimiterEnd!==!1||g!==d-1)&&k.push("|")}x.push(n.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return x.join(`
|
|
75
|
+
`)}function sj(e){return e==null?"":String(e)}function Kx(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function lj(e,t,n,r){const s=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const o=n.indentLines(n.containerFlow(e,l.current()),oj);return s(),o}function oj(e,t,n){return">"+(n?"":" ")+e}function uj(e,t){return Jx(e,t.inConstruct,!0)&&!Jx(e,t.notInConstruct,!1)}function Jx(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Wx(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
76
76
|
`&&uj(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
77
77
|
`}function cj(e,t){const n=String(e);let r=n.indexOf(t),s=r,l=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++l>o&&(o=l):l=1,s=r+t.length,r=n.indexOf(t,s);return o}function fj(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function dj(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function hj(e,t,n,r){const s=dj(n),l=e.value||"",o=s==="`"?"GraveAccent":"Tilde";if(fj(e,n)){const g=n.enter("codeIndented"),m=n.indentLines(l,pj);return g(),m}const c=n.createTracker(r),f=s.repeat(Math.max(cj(l,s)+1,3)),d=n.enter("codeFenced");let p=c.move(f);if(e.lang){const g=n.enter(`codeFencedLang${o}`);p+=c.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...c.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${o}`);p+=c.move(" "),p+=c.move(n.safe(e.meta,{before:p,after:`
|
|
78
78
|
`,encode:["`"],...c.current()})),g()}return p+=c.move(`
|
|
79
79
|
`),l&&(p+=c.move(l+`
|
|
80
80
|
`)),p+=c.move(f),d(),p}function pj(e,t,n){return(n?"":" ")+e}function wm(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function gj(e,t,n,r){const s=wm(n),l=s==='"'?"Quote":"Apostrophe",o=n.enter("definition");let c=n.enter("label");const f=n.createTracker(r);let d=f.move("[");return d+=f.move(n.safe(n.associationId(e),{before:d,after:"]",...f.current()})),d+=f.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(c=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":`
|
|
81
|
-
`,...f.current()}))),c(),e.title&&(c=n.enter(`title${l}`),d+=f.move(" "+s),d+=f.move(n.safe(e.title,{before:d,after:s,...f.current()})),d+=f.move(s),c()),o(),d}function mj(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Xl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function wc(e,t,n){const r=ds(e),s=ds(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}
|
|
81
|
+
`,...f.current()}))),c(),e.title&&(c=n.enter(`title${l}`),d+=f.move(" "+s),d+=f.move(n.safe(e.title,{before:d,after:s,...f.current()})),d+=f.move(s),c()),o(),d}function mj(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Xl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function wc(e,t,n){const r=ds(e),s=ds(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}NS.peek=yj;function NS(e,t,n,r){const s=mj(n),l=n.enter("emphasis"),o=n.createTracker(r),c=o.move(s);let f=o.move(n.containerPhrasing(e,{after:s,before:c,...o.current()}));const d=f.charCodeAt(0),p=wc(r.before.charCodeAt(r.before.length-1),d,s);p.inside&&(f=Xl(d)+f.slice(1));const g=f.charCodeAt(f.length-1),m=wc(r.after.charCodeAt(0),g,s);m.inside&&(f=f.slice(0,-1)+Xl(g));const b=o.move(s);return l(),n.attentionEncodeSurroundingInfo={after:m.outside,before:p.outside},c+f+b}function yj(e,t,n){return n.options.emphasis||"*"}function bj(e,t){let n=!1;return vm(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Cg}),!!((!e.depth||e.depth<3)&&dm(e)&&(t.options.setext||n))}function vj(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(bj(e,n)){const p=n.enter("headingSetext"),g=n.enter("phrasing"),m=n.containerPhrasing(e,{...l.current(),before:`
|
|
82
82
|
`,after:`
|
|
83
83
|
`});return g(),p(),m+`
|
|
84
84
|
`+(s===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(`
|
|
85
85
|
`))+1))}const o="#".repeat(s),c=n.enter("headingAtx"),f=n.enter("phrasing");l.move(o+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
|
|
86
|
-
`,...l.current()});return/^[\t ]/.test(d)&&(d=Xl(d.charCodeAt(0))+d.slice(1)),d=d?o+" "+d:o,n.options.closeAtx&&(d+=" "+o),f(),c(),d}CS.peek=xj;function CS(e){return e.value||""}function xj(){return"<"}
|
|
86
|
+
`,...l.current()});return/^[\t ]/.test(d)&&(d=Xl(d.charCodeAt(0))+d.slice(1)),d=d?o+" "+d:o,n.options.closeAtx&&(d+=" "+o),f(),c(),d}CS.peek=xj;function CS(e){return e.value||""}function xj(){return"<"}OS.peek=wj;function OS(e,t,n,r){const s=wm(n),l=s==='"'?"Quote":"Apostrophe",o=n.enter("image");let c=n.enter("label");const f=n.createTracker(r);let d=f.move("![");return d+=f.move(n.safe(e.alt,{before:d,after:"]",...f.current()})),d+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(c=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":")",...f.current()}))),c(),e.title&&(c=n.enter(`title${l}`),d+=f.move(" "+s),d+=f.move(n.safe(e.title,{before:d,after:s,...f.current()})),d+=f.move(s),c()),d+=f.move(")"),o(),d}function wj(){return"!"}MS.peek=_j;function MS(e,t,n,r){const s=e.referenceType,l=n.enter("imageReference");let o=n.enter("label");const c=n.createTracker(r);let f=c.move("![");const d=n.safe(e.alt,{before:f,after:"]",...c.current()});f+=c.move(d+"]["),o();const p=n.stack;n.stack=[],o=n.enter("reference");const g=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return o(),n.stack=p,l(),s==="full"||!d||d!==g?f+=c.move(g+"]"):s==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function _j(){return"!"}RS.peek=Sj;function RS(e,t,n){let r=e.value||"",s="`",l=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const o=n.unsafe[l],c=n.compilePattern(o);let f;if(o.atBreak)for(;f=c.exec(r);){let d=f.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(f.index+1)}}return s+r+s}function Sj(){return"`"}function DS(e,t){const n=dm(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}jS.peek=kj;function jS(e,t,n,r){const s=wm(n),l=s==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let c,f;if(DS(e,n)){const p=n.stack;n.stack=[],c=n.enter("autolink");let g=o.move("<");return g+=o.move(n.containerPhrasing(e,{before:g,after:">",...o.current()})),g+=o.move(">"),c(),n.stack=p,g}c=n.enter("link"),f=n.enter("label");let d=o.move("[");return d+=o.move(n.containerPhrasing(e,{before:d,after:"](",...o.current()})),d+=o.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),d+=o.move("<"),d+=o.move(n.safe(e.url,{before:d,after:">",...o.current()})),d+=o.move(">")):(f=n.enter("destinationRaw"),d+=o.move(n.safe(e.url,{before:d,after:e.title?" ":")",...o.current()}))),f(),e.title&&(f=n.enter(`title${l}`),d+=o.move(" "+s),d+=o.move(n.safe(e.title,{before:d,after:s,...o.current()})),d+=o.move(s),f()),d+=o.move(")"),c(),d}function kj(e,t,n){return DS(e,n)?"<":"["}zS.peek=Ej;function zS(e,t,n,r){const s=e.referenceType,l=n.enter("linkReference");let o=n.enter("label");const c=n.createTracker(r);let f=c.move("[");const d=n.containerPhrasing(e,{before:f,after:"]",...c.current()});f+=c.move(d+"]["),o();const p=n.stack;n.stack=[],o=n.enter("reference");const g=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return o(),n.stack=p,l(),s==="full"||!d||d!==g?f+=c.move(g+"]"):s==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function Ej(){return"["}function _m(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Aj(e){const t=_m(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Tj(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function LS(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Nj(e,t,n,r){const s=n.enter("list"),l=n.bulletCurrent;let o=e.ordered?Tj(n):_m(n);const c=e.ordered?o==="."?")":".":Aj(n);let f=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),LS(n)===o&&p){let g=-1;for(;++g<e.children.length;){const m=e.children[g];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(o=c),n.bulletCurrent=o;const d=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=l,s(),d}function Cj(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Oj(e,t,n,r){const s=Cj(n);let l=n.bulletCurrent||_m(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let o=l.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const c=n.createTracker(r);c.move(l+" ".repeat(o-l.length)),c.shift(o);const f=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,c.current()),p);return f(),d;function p(g,m,b){return m?(b?"":" ".repeat(o))+g:(b?l:l+" ".repeat(o-l.length))+g}}function Mj(e,t,n,r){const s=n.enter("paragraph"),l=n.enter("phrasing"),o=n.containerPhrasing(e,r);return l(),s(),o}const Rj=$c(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Dj(e,t,n,r){return(e.children.some(function(o){return Rj(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function jj(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}IS.peek=zj;function IS(e,t,n,r){const s=jj(n),l=n.enter("strong"),o=n.createTracker(r),c=o.move(s+s);let f=o.move(n.containerPhrasing(e,{after:s,before:c,...o.current()}));const d=f.charCodeAt(0),p=wc(r.before.charCodeAt(r.before.length-1),d,s);p.inside&&(f=Xl(d)+f.slice(1));const g=f.charCodeAt(f.length-1),m=wc(r.after.charCodeAt(0),g,s);m.inside&&(f=f.slice(0,-1)+Xl(g));const b=o.move(s+s);return l(),n.attentionEncodeSurroundingInfo={after:m.outside,before:p.outside},c+f+b}function zj(e,t,n){return n.options.strong||"*"}function Lj(e,t,n,r){return n.safe(e.value,r)}function Ij(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Bj(e,t,n){const r=(LS(n)+(n.options.ruleSpaces?" ":"")).repeat(Ij(n));return n.options.ruleSpaces?r.slice(0,-1):r}const BS={blockquote:lj,break:Wx,code:hj,definition:gj,emphasis:NS,hardBreak:Wx,heading:vj,html:CS,image:OS,imageReference:MS,inlineCode:RS,link:jS,linkReference:zS,list:Nj,listItem:Oj,paragraph:Mj,root:Dj,strong:IS,text:Lj,thematicBreak:Bj};function Fj(){return{enter:{table:Pj,tableData:e1,tableHeader:e1,tableRow:Hj},exit:{codeText:$j,table:Uj,tableData:Wh,tableHeader:Wh,tableRow:Wh}}}function Pj(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Uj(e){this.exit(e),this.data.inTable=void 0}function Hj(e){this.enter({type:"tableRow",children:[]},e)}function Wh(e){this.exit(e)}function e1(e){this.enter({type:"tableCell",children:[]},e)}function $j(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Vj));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Vj(e,t){return t==="|"?t:e}function qj(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
87
87
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:o,tableCell:f,tableRow:c}};function o(b,x,w,_){return d(p(b,w,_),b.align)}function c(b,x,w,_){const k=g(b,w,_),A=d([k]);return A.slice(0,A.indexOf(`
|
|
88
|
-
`))}function f(b,x,w,_){const k=w.enter("tableCell"),A=w.enter("phrasing"),S=w.containerPhrasing(b,{..._,before:l,after:l});return A(),k(),S}function d(b,x){return aj(b,{align:x,alignDelimiters:r,padding:n,stringLength:s})}function p(b,x,w){const _=b.children;let k=-1;const A=[],S=x.enter("table");for(;++k<_.length;)A[k]=g(_[k],x,w);return S(),A}function g(b,x,w){const _=b.children;let k=-1;const A=[],S=x.enter("tableRow");for(;++k<_.length;)A[k]=f(_[k],b,x,w);return S(),A}function m(b,x,w){let _=IS.inlineCode(b,x,w);return w.stack.includes("tableCell")&&(_=_.replace(/\|/g,"\\$&")),_}}function Gj(){return{exit:{taskListCheckValueChecked:e1,taskListCheckValueUnchecked:e1,paragraph:Yj}}}function Zj(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Xj}}}function e1(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Yj(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let l=-1,o;for(;++l<s.length;){const c=s[l];if(c.type==="paragraph"){o=c;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Xj(e,t,n,r){const s=e.children[0],l=typeof e.checked=="boolean"&&s&&s.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);l&&c.move(o);let f=IS.listItem(e,t,n,{...r,...c.current()});return l&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),f;function d(p){return p+o}}function Qj(){return[CD(),XD(),WD(),Fj(),Gj()]}function Kj(e){return{extensions:[ND(),QD(e),ej(),qj(e),Zj()]}}const Jj={tokenize:i3,partial:!0},BS={tokenize:a3,partial:!0},FS={tokenize:s3,partial:!0},PS={tokenize:l3,partial:!0},Wj={tokenize:o3,partial:!0},US={name:"wwwAutolink",tokenize:n3,previous:$S},HS={name:"protocolAutolink",tokenize:r3,previous:VS},Lr={name:"emailAutolink",tokenize:t3,previous:qS},ur={};function e3(){return{text:ur}}let Zi=48;for(;Zi<123;)ur[Zi]=Lr,Zi++,Zi===58?Zi=65:Zi===91&&(Zi=97);ur[43]=Lr;ur[45]=Lr;ur[46]=Lr;ur[95]=Lr;ur[72]=[Lr,HS];ur[104]=[Lr,HS];ur[87]=[Lr,US];ur[119]=[Lr,US];function t3(e,t,n){const r=this;let s,l;return o;function o(g){return!Dg(g)||!qS.call(r,r.previous)||Sm(r.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(g))}function c(g){return Dg(g)?(e.consume(g),c):g===64?(e.consume(g),f):n(g)}function f(g){return g===46?e.check(Wj,p,d)(g):g===45||g===95||Vt(g)?(l=!0,e.consume(g),f):p(g)}function d(g){return e.consume(g),s=!0,f}function p(g){return l&&s&&Qt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function n3(e,t,n){const r=this;return s;function s(o){return o!==87&&o!==119||!$S.call(r,r.previous)||Sm(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Jj,e.attempt(BS,e.attempt(FS,l),n),n)(o))}function l(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function r3(e,t,n){const r=this;let s="",l=!1;return o;function o(g){return(g===72||g===104)&&VS.call(r,r.previous)&&!Sm(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(g),e.consume(g),c):n(g)}function c(g){if(Qt(g)&&s.length<5)return s+=String.fromCodePoint(g),e.consume(g),c;if(g===58){const m=s.toLowerCase();if(m==="http"||m==="https")return e.consume(g),f}return n(g)}function f(g){return g===47?(e.consume(g),l?d:(l=!0,f)):n(g)}function d(g){return g===null||bc(g)||st(g)||ia(g)||Pc(g)?n(g):e.attempt(BS,e.attempt(FS,p),n)(g)}function p(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function i3(e,t,n){let r=0;return s;function s(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),s):o===46&&r===3?(e.consume(o),l):n(o)}function l(o){return o===null?n(o):t(o)}}function a3(e,t,n){let r,s,l;return o;function o(d){return d===46||d===95?e.check(PS,f,c)(d):d===null||st(d)||ia(d)||d!==45&&Pc(d)?f(d):(l=!0,e.consume(d),o)}function c(d){return d===95?r=!0:(s=r,r=void 0),e.consume(d),o}function f(d){return s||r||!l?n(d):t(d)}}function s3(e,t){let n=0,r=0;return s;function s(o){return o===40?(n++,e.consume(o),s):o===41&&r<n?l(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(PS,t,l)(o):o===null||st(o)||ia(o)?t(o):(e.consume(o),s)}function l(o){return o===41&&r++,e.consume(o),s}}function l3(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),l):c===93?(e.consume(c),s):c===60||c===null||st(c)||ia(c)?t(c):n(c)}function s(c){return c===null||c===40||c===91||st(c)||ia(c)?t(c):r(c)}function l(c){return Qt(c)?o(c):n(c)}function o(c){return c===59?(e.consume(c),r):Qt(c)?(e.consume(c),o):n(c)}}function o3(e,t,n){return r;function r(l){return e.consume(l),s}function s(l){return Vt(l)?n(l):t(l)}}function $S(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||st(e)}function VS(e){return!Qt(e)}function qS(e){return!(e===47||Dg(e))}function Dg(e){return e===43||e===45||e===46||e===95||Vt(e)}function Sm(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const u3={tokenize:y3,partial:!0};function c3(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:p3,continuation:{tokenize:g3},exit:m3}},text:{91:{name:"gfmFootnoteCall",tokenize:h3},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:f3,resolveTo:d3}}}}function f3(e,t,n){const r=this;let s=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;s--;){const f=r.events[s][1];if(f.type==="labelImage"){o=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return c;function c(f){if(!o||!o._balanced)return n(f);const d=Gn(r.sliceSerialize({start:o.end,end:r.now()}));return d.codePointAt(0)!==94||!l.includes(d.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function d3(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function h3(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,o;return c;function c(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),f}function f(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(g){if(l>999||g===93&&!o||g===null||g===91||st(g))return n(g);if(g===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return s.includes(Gn(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return st(g)||(o=!0),l++,e.consume(g),g===92?p:d}function p(g){return g===91||g===92||g===93?(e.consume(g),l++,d):d(g)}}function p3(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,o=0,c;return f;function f(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(x)}function p(x){if(o>999||x===93&&!c||x===null||x===91||st(x))return n(x);if(x===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return l=Gn(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return st(x)||(c=!0),o++,e.consume(x),x===92?g:p}function g(x){return x===91||x===92||x===93?(e.consume(x),o++,p):p(x)}function m(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),s.includes(l)||s.push(l),qe(e,b,"gfmFootnoteDefinitionWhitespace")):n(x)}function b(x){return t(x)}}function g3(e,t,n){return e.check(oo,t,e.attempt(u3,t,n))}function m3(e){e.exit("gfmFootnoteDefinition")}function y3(e,t,n){const r=this;return qe(e,s,"gfmFootnoteDefinitionIndent",5);function s(l){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(l):n(l)}}function b3(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(o,c){let f=-1;for(;++f<o.length;)if(o[f][0]==="enter"&&o[f][1].type==="strikethroughSequenceTemporary"&&o[f][1]._close){let d=f;for(;d--;)if(o[d][0]==="exit"&&o[d][1].type==="strikethroughSequenceTemporary"&&o[d][1]._open&&o[f][1].end.offset-o[f][1].start.offset===o[d][1].end.offset-o[d][1].start.offset){o[f][1].type="strikethroughSequence",o[d][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},o[d][1].start),end:Object.assign({},o[f][1].end)},g={type:"strikethroughText",start:Object.assign({},o[d][1].end),end:Object.assign({},o[f][1].start)},m=[["enter",p,c],["enter",o[d][1],c],["exit",o[d][1],c],["enter",g,c]],b=c.parser.constructs.insideSpan.null;b&&xn(m,m.length,0,Uc(b,o.slice(d+1,f),c)),xn(m,m.length,0,[["exit",g,c],["enter",o[f][1],c],["exit",o[f][1],c],["exit",p,c]]),xn(o,d-1,f-d+3,m),f=d+m.length-2;break}}for(f=-1;++f<o.length;)o[f][1].type==="strikethroughSequenceTemporary"&&(o[f][1].type="data");return o}function l(o,c,f){const d=this.previous,p=this.events;let g=0;return m;function m(x){return d===126&&p[p.length-1][1].type!=="characterEscape"?f(x):(o.enter("strikethroughSequenceTemporary"),b(x))}function b(x){const w=ds(d);if(x===126)return g>1?f(x):(o.consume(x),g++,b);if(g<2&&!n)return f(x);const _=o.exit("strikethroughSequenceTemporary"),k=ds(x);return _._open=!k||k===2&&!!w,_._close=!w||w===2&&!!k,c(x)}}}class v3{constructor(){this.map=[]}add(t,n,r){x3(this,t,n,r)}consume(t){if(this.map.sort(function(l,o){return l[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const l of s)t.push(l);s=r.pop()}this.map.length=0}}function x3(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function w3(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function _3(){return{flow:{null:{name:"table",tokenize:S3,resolveAll:k3}}}}function S3(e,t,n){const r=this;let s=0,l=0,o;return c;function c(j){let H=r.events.length-1;for(;H>-1;){const R=r.events[H][1].type;if(R==="lineEnding"||R==="linePrefix")H--;else break}const B=H>-1?r.events[H][1].type:null,q=B==="tableHead"||B==="tableRow"?M:f;return q===M&&r.parser.lazy[r.now().line]?n(j):q(j)}function f(j){return e.enter("tableHead"),e.enter("tableRow"),d(j)}function d(j){return j===124||(o=!0,l+=1),p(j)}function p(j){return j===null?n(j):Ce(j)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),b):n(j):$e(j)?qe(e,p,"whitespace")(j):(l+=1,o&&(o=!1,s+=1),j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),o=!0,p):(e.enter("data"),g(j)))}function g(j){return j===null||j===124||st(j)?(e.exit("data"),p(j)):(e.consume(j),j===92?m:g)}function m(j){return j===92||j===124?(e.consume(j),g):g(j)}function b(j){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(j):(e.enter("tableDelimiterRow"),o=!1,$e(j)?qe(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):x(j))}function x(j){return j===45||j===58?_(j):j===124?(o=!0,e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),w):D(j)}function w(j){return $e(j)?qe(e,_,"whitespace")(j):_(j)}function _(j){return j===58?(l+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),k):j===45?(l+=1,k(j)):j===null||Ce(j)?O(j):D(j)}function k(j){return j===45?(e.enter("tableDelimiterFiller"),A(j)):D(j)}function A(j){return j===45?(e.consume(j),A):j===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(j))}function S(j){return $e(j)?qe(e,O,"whitespace")(j):O(j)}function O(j){return j===124?x(j):j===null||Ce(j)?!o||s!==l?D(j):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(j)):D(j)}function D(j){return n(j)}function M(j){return e.enter("tableRow"),F(j)}function F(j){return j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),F):j===null||Ce(j)?(e.exit("tableRow"),t(j)):$e(j)?qe(e,F,"whitespace")(j):(e.enter("data"),L(j))}function L(j){return j===null||j===124||st(j)?(e.exit("data"),F(j)):(e.consume(j),j===92?U:L)}function U(j){return j===92||j===124?(e.consume(j),L):L(j)}}function k3(e,t){let n=-1,r=!0,s=0,l=[0,0,0,0],o=[0,0,0,0],c=!1,f=0,d,p,g;const m=new v3;for(;++n<e.length;){const b=e[n],x=b[1];b[0]==="enter"?x.type==="tableHead"?(c=!1,f!==0&&(t1(m,t,f,d,p),p=void 0,f=0),d={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},m.add(n,0,[["enter",d,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,g=void 0,l=[0,0,0,0],o=[0,n+1,0,0],c&&(c=!1,p={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},m.add(n,0,[["enter",p,t]])),s=x.type==="tableDelimiterRow"?2:p?3:1):s&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(l[1]!==0&&(o[0]=o[1],g=Vu(m,t,l,s,void 0,g),l=[0,0,0,0]),o[2]=n)):x.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(o[0]=o[1],g=Vu(m,t,l,s,void 0,g)),l=o,o=[l[1],n,0,0])):x.type==="tableHead"?(c=!0,f=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(f=n,l[1]!==0?(o[0]=o[1],g=Vu(m,t,l,s,n,g)):o[1]!==0&&(g=Vu(m,t,o,s,n,g)),s=0):s&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(o[3]=n)}for(f!==0&&t1(m,t,f,d,p),m.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=w3(t.events,n))}return e}function Vu(e,t,n,r,s,l){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(l.end=Object.assign({},Wa(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const f=Wa(t.events,n[1]);if(l={type:o,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const d=Wa(t.events,n[2]),p=Wa(t.events,n[3]),g={type:c,start:Object.assign({},d),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",g,t]]),r!==2){const m=t.events[n[2]],b=t.events[n[3]];if(m[1].end=Object.assign({},b[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,w=n[3]-n[2]-1;e.add(x,w,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return s!==void 0&&(l.end=Object.assign({},Wa(t.events,s)),e.add(s,0,[["exit",l,t]]),l=void 0),l}function t1(e,t,n,r,s){const l=[],o=Wa(t.events,n);s&&(s.end=Object.assign({},o),l.push(["exit",s,t])),r.end=Object.assign({},o),l.push(["exit",r,t]),e.add(n+1,0,l)}function Wa(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const E3={name:"tasklistCheck",tokenize:T3};function A3(){return{text:{91:E3}}}function T3(e,t,n){const r=this;return s;function s(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),l)}function l(f){return st(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),o):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),o):n(f)}function o(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(f)}function c(f){return Ce(f)?t(f):$e(f)?e.check({tokenize:C3},t,n)(f):n(f)}}function C3(e,t,n){return qe(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function N3(e){return tS([e3(),c3(),b3(e),_3(),A3()])}const O3={};function GS(e){const t=this,n=e||O3,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(N3(n)),l.push(Qj()),o.push(Kj(n))}const M3=({message:e})=>C.jsx("div",{className:"flex flex-col w-[80%] bg-white rounded-lg shadow-sm border border-gray-200",children:C.jsxs("div",{className:"flex flex-col p-4",children:[C.jsx("div",{className:"text-sm font-medium text-gray-700 mb-2",children:e.name}),C.jsx("div",{className:"markdown-body max-w-none",children:C.jsx(_S,{remarkPlugins:[GS],children:am(e.content)})}),C.jsx(rm,{response_metadata:e.response_metadata,usage_metadata:e.usage_metadata||{},spend_time:e.spend_time,id:e.id})]})});/**
|
|
88
|
+
`))}function f(b,x,w,_){const k=w.enter("tableCell"),A=w.enter("phrasing"),S=w.containerPhrasing(b,{..._,before:l,after:l});return A(),k(),S}function d(b,x){return aj(b,{align:x,alignDelimiters:r,padding:n,stringLength:s})}function p(b,x,w){const _=b.children;let k=-1;const A=[],S=x.enter("table");for(;++k<_.length;)A[k]=g(_[k],x,w);return S(),A}function g(b,x,w){const _=b.children;let k=-1;const A=[],S=x.enter("tableRow");for(;++k<_.length;)A[k]=f(_[k],b,x,w);return S(),A}function m(b,x,w){let _=BS.inlineCode(b,x,w);return w.stack.includes("tableCell")&&(_=_.replace(/\|/g,"\\$&")),_}}function Gj(){return{exit:{taskListCheckValueChecked:t1,taskListCheckValueUnchecked:t1,paragraph:Yj}}}function Zj(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Xj}}}function t1(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Yj(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let l=-1,o;for(;++l<s.length;){const c=s[l];if(c.type==="paragraph"){o=c;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Xj(e,t,n,r){const s=e.children[0],l=typeof e.checked=="boolean"&&s&&s.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);l&&c.move(o);let f=BS.listItem(e,t,n,{...r,...c.current()});return l&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),f;function d(p){return p+o}}function Qj(){return[ND(),XD(),WD(),Fj(),Gj()]}function Kj(e){return{extensions:[CD(),QD(e),ej(),qj(e),Zj()]}}const Jj={tokenize:i3,partial:!0},FS={tokenize:a3,partial:!0},PS={tokenize:s3,partial:!0},US={tokenize:l3,partial:!0},Wj={tokenize:o3,partial:!0},HS={name:"wwwAutolink",tokenize:n3,previous:VS},$S={name:"protocolAutolink",tokenize:r3,previous:qS},Lr={name:"emailAutolink",tokenize:t3,previous:GS},ur={};function e3(){return{text:ur}}let Zi=48;for(;Zi<123;)ur[Zi]=Lr,Zi++,Zi===58?Zi=65:Zi===91&&(Zi=97);ur[43]=Lr;ur[45]=Lr;ur[46]=Lr;ur[95]=Lr;ur[72]=[Lr,$S];ur[104]=[Lr,$S];ur[87]=[Lr,HS];ur[119]=[Lr,HS];function t3(e,t,n){const r=this;let s,l;return o;function o(g){return!Dg(g)||!GS.call(r,r.previous)||Sm(r.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(g))}function c(g){return Dg(g)?(e.consume(g),c):g===64?(e.consume(g),f):n(g)}function f(g){return g===46?e.check(Wj,p,d)(g):g===45||g===95||Vt(g)?(l=!0,e.consume(g),f):p(g)}function d(g){return e.consume(g),s=!0,f}function p(g){return l&&s&&Qt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function n3(e,t,n){const r=this;return s;function s(o){return o!==87&&o!==119||!VS.call(r,r.previous)||Sm(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Jj,e.attempt(FS,e.attempt(PS,l),n),n)(o))}function l(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function r3(e,t,n){const r=this;let s="",l=!1;return o;function o(g){return(g===72||g===104)&&qS.call(r,r.previous)&&!Sm(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(g),e.consume(g),c):n(g)}function c(g){if(Qt(g)&&s.length<5)return s+=String.fromCodePoint(g),e.consume(g),c;if(g===58){const m=s.toLowerCase();if(m==="http"||m==="https")return e.consume(g),f}return n(g)}function f(g){return g===47?(e.consume(g),l?d:(l=!0,f)):n(g)}function d(g){return g===null||bc(g)||st(g)||ia(g)||Pc(g)?n(g):e.attempt(FS,e.attempt(PS,p),n)(g)}function p(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function i3(e,t,n){let r=0;return s;function s(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),s):o===46&&r===3?(e.consume(o),l):n(o)}function l(o){return o===null?n(o):t(o)}}function a3(e,t,n){let r,s,l;return o;function o(d){return d===46||d===95?e.check(US,f,c)(d):d===null||st(d)||ia(d)||d!==45&&Pc(d)?f(d):(l=!0,e.consume(d),o)}function c(d){return d===95?r=!0:(s=r,r=void 0),e.consume(d),o}function f(d){return s||r||!l?n(d):t(d)}}function s3(e,t){let n=0,r=0;return s;function s(o){return o===40?(n++,e.consume(o),s):o===41&&r<n?l(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(US,t,l)(o):o===null||st(o)||ia(o)?t(o):(e.consume(o),s)}function l(o){return o===41&&r++,e.consume(o),s}}function l3(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),l):c===93?(e.consume(c),s):c===60||c===null||st(c)||ia(c)?t(c):n(c)}function s(c){return c===null||c===40||c===91||st(c)||ia(c)?t(c):r(c)}function l(c){return Qt(c)?o(c):n(c)}function o(c){return c===59?(e.consume(c),r):Qt(c)?(e.consume(c),o):n(c)}}function o3(e,t,n){return r;function r(l){return e.consume(l),s}function s(l){return Vt(l)?n(l):t(l)}}function VS(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||st(e)}function qS(e){return!Qt(e)}function GS(e){return!(e===47||Dg(e))}function Dg(e){return e===43||e===45||e===46||e===95||Vt(e)}function Sm(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const u3={tokenize:y3,partial:!0};function c3(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:p3,continuation:{tokenize:g3},exit:m3}},text:{91:{name:"gfmFootnoteCall",tokenize:h3},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:f3,resolveTo:d3}}}}function f3(e,t,n){const r=this;let s=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;s--;){const f=r.events[s][1];if(f.type==="labelImage"){o=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return c;function c(f){if(!o||!o._balanced)return n(f);const d=Gn(r.sliceSerialize({start:o.end,end:r.now()}));return d.codePointAt(0)!==94||!l.includes(d.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function d3(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function h3(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,o;return c;function c(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),f}function f(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(g){if(l>999||g===93&&!o||g===null||g===91||st(g))return n(g);if(g===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return s.includes(Gn(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return st(g)||(o=!0),l++,e.consume(g),g===92?p:d}function p(g){return g===91||g===92||g===93?(e.consume(g),l++,d):d(g)}}function p3(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,o=0,c;return f;function f(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(x)}function p(x){if(o>999||x===93&&!c||x===null||x===91||st(x))return n(x);if(x===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return l=Gn(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return st(x)||(c=!0),o++,e.consume(x),x===92?g:p}function g(x){return x===91||x===92||x===93?(e.consume(x),o++,p):p(x)}function m(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),s.includes(l)||s.push(l),qe(e,b,"gfmFootnoteDefinitionWhitespace")):n(x)}function b(x){return t(x)}}function g3(e,t,n){return e.check(oo,t,e.attempt(u3,t,n))}function m3(e){e.exit("gfmFootnoteDefinition")}function y3(e,t,n){const r=this;return qe(e,s,"gfmFootnoteDefinitionIndent",5);function s(l){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(l):n(l)}}function b3(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(o,c){let f=-1;for(;++f<o.length;)if(o[f][0]==="enter"&&o[f][1].type==="strikethroughSequenceTemporary"&&o[f][1]._close){let d=f;for(;d--;)if(o[d][0]==="exit"&&o[d][1].type==="strikethroughSequenceTemporary"&&o[d][1]._open&&o[f][1].end.offset-o[f][1].start.offset===o[d][1].end.offset-o[d][1].start.offset){o[f][1].type="strikethroughSequence",o[d][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},o[d][1].start),end:Object.assign({},o[f][1].end)},g={type:"strikethroughText",start:Object.assign({},o[d][1].end),end:Object.assign({},o[f][1].start)},m=[["enter",p,c],["enter",o[d][1],c],["exit",o[d][1],c],["enter",g,c]],b=c.parser.constructs.insideSpan.null;b&&xn(m,m.length,0,Uc(b,o.slice(d+1,f),c)),xn(m,m.length,0,[["exit",g,c],["enter",o[f][1],c],["exit",o[f][1],c],["exit",p,c]]),xn(o,d-1,f-d+3,m),f=d+m.length-2;break}}for(f=-1;++f<o.length;)o[f][1].type==="strikethroughSequenceTemporary"&&(o[f][1].type="data");return o}function l(o,c,f){const d=this.previous,p=this.events;let g=0;return m;function m(x){return d===126&&p[p.length-1][1].type!=="characterEscape"?f(x):(o.enter("strikethroughSequenceTemporary"),b(x))}function b(x){const w=ds(d);if(x===126)return g>1?f(x):(o.consume(x),g++,b);if(g<2&&!n)return f(x);const _=o.exit("strikethroughSequenceTemporary"),k=ds(x);return _._open=!k||k===2&&!!w,_._close=!w||w===2&&!!k,c(x)}}}class v3{constructor(){this.map=[]}add(t,n,r){x3(this,t,n,r)}consume(t){if(this.map.sort(function(l,o){return l[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const l of s)t.push(l);s=r.pop()}this.map.length=0}}function x3(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function w3(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function _3(){return{flow:{null:{name:"table",tokenize:S3,resolveAll:k3}}}}function S3(e,t,n){const r=this;let s=0,l=0,o;return c;function c(j){let H=r.events.length-1;for(;H>-1;){const R=r.events[H][1].type;if(R==="lineEnding"||R==="linePrefix")H--;else break}const B=H>-1?r.events[H][1].type:null,q=B==="tableHead"||B==="tableRow"?M:f;return q===M&&r.parser.lazy[r.now().line]?n(j):q(j)}function f(j){return e.enter("tableHead"),e.enter("tableRow"),d(j)}function d(j){return j===124||(o=!0,l+=1),p(j)}function p(j){return j===null?n(j):Ne(j)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),b):n(j):$e(j)?qe(e,p,"whitespace")(j):(l+=1,o&&(o=!1,s+=1),j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),o=!0,p):(e.enter("data"),g(j)))}function g(j){return j===null||j===124||st(j)?(e.exit("data"),p(j)):(e.consume(j),j===92?m:g)}function m(j){return j===92||j===124?(e.consume(j),g):g(j)}function b(j){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(j):(e.enter("tableDelimiterRow"),o=!1,$e(j)?qe(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):x(j))}function x(j){return j===45||j===58?_(j):j===124?(o=!0,e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),w):D(j)}function w(j){return $e(j)?qe(e,_,"whitespace")(j):_(j)}function _(j){return j===58?(l+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),k):j===45?(l+=1,k(j)):j===null||Ne(j)?O(j):D(j)}function k(j){return j===45?(e.enter("tableDelimiterFiller"),A(j)):D(j)}function A(j){return j===45?(e.consume(j),A):j===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(j))}function S(j){return $e(j)?qe(e,O,"whitespace")(j):O(j)}function O(j){return j===124?x(j):j===null||Ne(j)?!o||s!==l?D(j):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(j)):D(j)}function D(j){return n(j)}function M(j){return e.enter("tableRow"),F(j)}function F(j){return j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),F):j===null||Ne(j)?(e.exit("tableRow"),t(j)):$e(j)?qe(e,F,"whitespace")(j):(e.enter("data"),L(j))}function L(j){return j===null||j===124||st(j)?(e.exit("data"),F(j)):(e.consume(j),j===92?U:L)}function U(j){return j===92||j===124?(e.consume(j),L):L(j)}}function k3(e,t){let n=-1,r=!0,s=0,l=[0,0,0,0],o=[0,0,0,0],c=!1,f=0,d,p,g;const m=new v3;for(;++n<e.length;){const b=e[n],x=b[1];b[0]==="enter"?x.type==="tableHead"?(c=!1,f!==0&&(n1(m,t,f,d,p),p=void 0,f=0),d={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},m.add(n,0,[["enter",d,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,g=void 0,l=[0,0,0,0],o=[0,n+1,0,0],c&&(c=!1,p={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},m.add(n,0,[["enter",p,t]])),s=x.type==="tableDelimiterRow"?2:p?3:1):s&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(l[1]!==0&&(o[0]=o[1],g=Vu(m,t,l,s,void 0,g),l=[0,0,0,0]),o[2]=n)):x.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(o[0]=o[1],g=Vu(m,t,l,s,void 0,g)),l=o,o=[l[1],n,0,0])):x.type==="tableHead"?(c=!0,f=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(f=n,l[1]!==0?(o[0]=o[1],g=Vu(m,t,l,s,n,g)):o[1]!==0&&(g=Vu(m,t,o,s,n,g)),s=0):s&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(o[3]=n)}for(f!==0&&n1(m,t,f,d,p),m.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=w3(t.events,n))}return e}function Vu(e,t,n,r,s,l){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(l.end=Object.assign({},Wa(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const f=Wa(t.events,n[1]);if(l={type:o,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const d=Wa(t.events,n[2]),p=Wa(t.events,n[3]),g={type:c,start:Object.assign({},d),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",g,t]]),r!==2){const m=t.events[n[2]],b=t.events[n[3]];if(m[1].end=Object.assign({},b[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,w=n[3]-n[2]-1;e.add(x,w,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return s!==void 0&&(l.end=Object.assign({},Wa(t.events,s)),e.add(s,0,[["exit",l,t]]),l=void 0),l}function n1(e,t,n,r,s){const l=[],o=Wa(t.events,n);s&&(s.end=Object.assign({},o),l.push(["exit",s,t])),r.end=Object.assign({},o),l.push(["exit",r,t]),e.add(n+1,0,l)}function Wa(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const E3={name:"tasklistCheck",tokenize:T3};function A3(){return{text:{91:E3}}}function T3(e,t,n){const r=this;return s;function s(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),l)}function l(f){return st(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),o):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),o):n(f)}function o(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(f)}function c(f){return Ne(f)?t(f):$e(f)?e.check({tokenize:N3},t,n)(f):n(f)}}function N3(e,t,n){return qe(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function C3(e){return nS([e3(),c3(),b3(e),_3(),A3()])}const O3={};function ZS(e){const t=this,n=e||O3,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(C3(n)),l.push(Qj()),o.push(Kj(n))}const M3=({message:e})=>N.jsx("div",{className:"flex flex-col w-[80%] bg-white rounded-lg shadow-sm border border-gray-200",children:N.jsxs("div",{className:"flex flex-col p-4",children:[N.jsx("div",{className:"text-sm font-medium text-gray-700 mb-2",children:e.name}),N.jsx("div",{className:"markdown-body max-w-none",children:N.jsx(SS,{remarkPlugins:[ZS],children:am(e.content)})}),N.jsx(rm,{response_metadata:e.response_metadata,usage_metadata:e.usage_metadata||{},spend_time:e.spend_time,id:e.id})]})});/**
|
|
89
89
|
* @license lucide-react v0.511.0 - ISC
|
|
90
90
|
*
|
|
91
91
|
* This source code is licensed under the ISC license.
|
|
92
92
|
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
-
*/const R3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),D3=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),
|
|
93
|
+
*/const R3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),D3=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),r1=e=>{const t=D3(e);return t.charAt(0).toUpperCase()+t.slice(1)},YS=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),j3=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
94
94
|
* @license lucide-react v0.511.0 - ISC
|
|
95
95
|
*
|
|
96
96
|
* This source code is licensed under the ISC license.
|
|
@@ -100,12 +100,12 @@ Error generating stack: `+u.message+`
|
|
|
100
100
|
*
|
|
101
101
|
* This source code is licensed under the ISC license.
|
|
102
102
|
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
-
*/const L3=W.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:l,iconNode:o,...c},f)=>W.createElement("svg",{ref:f,...z3,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:
|
|
103
|
+
*/const L3=W.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:l,iconNode:o,...c},f)=>W.createElement("svg",{ref:f,...z3,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:YS("lucide",s),...!l&&!j3(c)&&{"aria-hidden":"true"},...c},[...o.map(([d,p])=>W.createElement(d,p)),...Array.isArray(l)?l:[l]]));/**
|
|
104
104
|
* @license lucide-react v0.511.0 - ISC
|
|
105
105
|
*
|
|
106
106
|
* This source code is licensed under the ISC license.
|
|
107
107
|
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
-
*/const Ft=(e,t)=>{const n=W.forwardRef(({className:r,...s},l)=>W.createElement(L3,{ref:l,iconNode:t,className:
|
|
108
|
+
*/const Ft=(e,t)=>{const n=W.forwardRef(({className:r,...s},l)=>W.createElement(L3,{ref:l,iconNode:t,className:YS(`lucide-${R3(r1(e))}`,`lucide-${e}`,r),...s}));return n.displayName=r1(e),n};/**
|
|
109
109
|
* @license lucide-react v0.511.0 - ISC
|
|
110
110
|
*
|
|
111
111
|
* This source code is licensed under the ISC license.
|
|
@@ -130,7 +130,7 @@ Error generating stack: `+u.message+`
|
|
|
130
130
|
*
|
|
131
131
|
* This source code is licensed under the ISC license.
|
|
132
132
|
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
-
*/const q3=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],
|
|
133
|
+
*/const q3=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],XS=Ft("file-json",q3);/**
|
|
134
134
|
* @license lucide-react v0.511.0 - ISC
|
|
135
135
|
*
|
|
136
136
|
* This source code is licensed under the ISC license.
|
|
@@ -190,7 +190,7 @@ Error generating stack: `+u.message+`
|
|
|
190
190
|
*
|
|
191
191
|
* This source code is licensed under the ISC license.
|
|
192
192
|
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
-
*/const pz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],
|
|
193
|
+
*/const pz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],QS=Ft("x",pz),gz=fs({name:"ask_user_for_approve",description:"Request user review and approval for plans or content, wait for user feedback before proceeding",parameters:[{name:"title",type:"string",description:"Title or subject of the content to be reviewed"}],onlyRender:!0,handler:L_.waitForUIDone,render(e){var o;const t=e.getInputRepaired(),[n,r]=W.useState(((o=e.getJSONOutputSafe())==null?void 0:o.feedback)||""),s=()=>{const c={approved:!0,feedback:n.trim()||null};e.response(c)},l=()=>{const c={approved:!1,feedback:n.trim()||"用户拒绝了请求"};e.response(c)};return N.jsxs("div",{className:"flex flex-col gap-3 p-4 bg-white rounded-lg border border-gray-200",children:[N.jsxs("div",{className:"flex items-center gap-2 text-gray-700",children:[N.jsx(fz,{className:"w-4 h-4 text-blue-500"}),N.jsx("span",{children:"请求审核批准"}),t.title&&N.jsx("span",{className:"text-sm text-gray-500 ml-2 truncate max-w-[200px]",children:t.title})]}),N.jsxs("div",{className:"flex gap-2",children:[N.jsx("textarea",{disabled:e.state==="done",className:"flex-1 p-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent disabled:bg-gray-50 disabled:text-gray-500",placeholder:"反馈意见(可选)",value:n,onChange:c=>r(c.target.value),rows:1}),N.jsxs("button",{disabled:e.state==="done",className:"px-3 py-2 text-sm font-medium text-white bg-green-500 rounded-lg hover:bg-green-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",onClick:s,children:[N.jsx(H3,{className:"w-4 h-4"}),"批准"]}),N.jsxs("button",{disabled:e.state==="done",className:"px-3 py-2 text-sm font-medium text-white bg-red-500 rounded-lg hover:bg-red-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",onClick:l,children:[N.jsx(V3,{className:"w-4 h-4"}),"拒绝"]})]})]})}}),mz=fs({name:"update_plan",description:"展示当前执行计划,等待用户确认",parameters:[],onlyRender:!0,render(e){const n=e.getInputRepaired()||{thought:"",steps:[]};return N.jsxs("div",{className:"p-3 bg-white rounded-lg border border-gray-200",children:[N.jsxs("div",{className:"flex items-center gap-1.5 text-gray-700 mb-2 font-bold",children:[N.jsx(Z3,{className:"w-3.5 h-3.5 text-blue-500"}),N.jsx("span",{children:"执行计划"})]}),N.jsxs("div",{className:"space-y-2",children:[n.title&&N.jsxs("div",{className:"text-sm",children:[N.jsx("span",{className:"text-gray-500",children:"标题:"}),N.jsx("span",{children:n.title})]}),n.thought&&N.jsxs("div",{className:"text-sm",children:[N.jsx("span",{className:"text-gray-500",children:"思考:"}),N.jsx("span",{className:"whitespace-pre-wrap",children:n.thought})]}),n.steps&&n.steps.length>0&&N.jsxs("div",{className:"space-y-1.5",children:[N.jsx("div",{className:"text-sm text-gray-500",children:"步骤:"}),n.steps.map((r,s)=>N.jsxs("div",{className:"pl-2 border-l-2 border-gray-200",children:[N.jsxs("div",{className:"flex items-center gap-1.5 text-sm",children:[r.step_type==="research"?N.jsx(K3,{className:"w-3.5 h-3.5 text-blue-500"}):N.jsx(B3,{className:"w-3.5 h-3.5 text-purple-500"}),N.jsx("span",{className:"font-medium",children:r.title}),r.need_web_search&&N.jsx("span",{className:"text-xs text-blue-500",children:"[搜索]"})]}),N.jsx("div",{className:"text-sm text-gray-600 pl-5",children:r.description})]},s))]})]})]})}}),yz=fs({name:"web_search",description:"A powerful web search tool that provides comprehensive, real-time results using search engine. Returns relevant web content with customizable parameters for result count, content type, and domain filtering. Ideal for gathering current information, news, and detailed web content analysis.",parameters:[],onlyRender:!0,render(e){var c;const t=e.getInputRepaired(),n=((c=e.getJSONOutputSafe())==null?void 0:c.flatMap(f=>f.results))||[],[r,s]=W.useState(new Set),l=f=>{const d=new Set(r);d.has(f)?d.delete(f):d.add(f),s(d)},o=f=>{window.open(f,"_blank","noopener,noreferrer")};return N.jsxs("div",{className:"p-4 space-y-4",children:[N.jsxs("div",{className:"text-sm text-gray-500",children:["Search Query: ",t.query,";Get ",n.length," results"]}),N.jsx("div",{className:"space-y-3 max-h-[300px] overflow-y-auto",children:n.map((f,d)=>N.jsxs("div",{className:"border rounded-lg p-2 hover:bg-gray-50",children:[N.jsxs("div",{className:"flex items-center justify-between select-none cursor-pointer",onClick:()=>l(d),children:[N.jsx("span",{className:"font-xs flex-1",children:f.title}),N.jsx("div",{onClick:p=>{p.stopPropagation(),o(f.url)},className:"px-3 py-1 text-sm",children:N.jsx(tz,{className:"w-4 h-4"})}),N.jsx("span",{className:"text-gray-400",children:r.has(d)?"▼":"▶"})]}),r.has(d)&&N.jsxs("div",{className:"mt-3 space-y-2",children:[N.jsx("p",{className:"text-sm text-gray-600",children:f.description}),N.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500",children:[N.jsx("span",{children:new Date(f.updateTime).toLocaleDateString()}),N.jsx("span",{children:"•"}),N.jsx("span",{children:f.metadata.engines.join(", ")})]})]})]},d))})]})}});function bz(e){return"default"}function vz(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null||Array.isArray(e)||typeof e=="object"?e:String(e)}const xz=e=>({manageMemory:fs({name:"manage_memory",description:`这是一个**结构化**工具,用于**管理跨对话的持久化记忆**,以保留上下文、用户偏好和学习到的见解。它支持**创建、更新、检索和删除记忆条目**,从而在互动中保持连续性和个性化。
|
|
194
194
|
|
|
195
195
|
### 你需要记录记忆的场景
|
|
196
196
|
|
|
@@ -205,10 +205,10 @@ Error generating stack: `+u.message+`
|
|
|
205
205
|
* **记忆生命周期管理:** 对记忆条目进行**全生命周期管理**,包括创建、更新、检索和删除。
|
|
206
206
|
* **分段与标签支持:** 支持**分段或打标签的记忆条目**,方便分类和高效检索。
|
|
207
207
|
* **存储选项灵活:** 提供**临时和永久两种存储选项**,以适应不同类型信息的存储需求。
|
|
208
|
-
`,parameters:[{name:"path",type:"string",description:"记忆路径(创建时需要)"},{name:"tags",type:"string[]",description:"记忆标签(创建或更新时需要)"},{name:"content",type:"string",description:"记忆内容(创建或更新时需要)"},{name:"action",type:"string",enum:["create","update","delete"],description:"操作类型:create(创建)、update(更新)、delete(删除)"},{name:"id",type:"string",description:"记忆ID(更新或删除时需要,创建时会自动生成)",required:!1},{name:"referencePath",type:"string",description:"引用文档的 URL",required:!1}],handler:async t=>{const{content:n,action:r,id:s,tags:l,path:o,referencePath:c}=t;if((r==="delete"||r==="update")&&!s)throw new Error("删除或更新记忆时必须提供记忆ID");if((r==="create"||r==="update")&&!n)throw new Error("创建或更新记忆时必须提供内容");try{if(r==="delete")return await e.delete(Number(s)),`已删除记忆 ${s}`;const f={text:n,content:vz(n),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),namespace:bz(),tags:l,path:o,type:"document",referencePath:c};return r==="create"?`已创建记忆 ${await e.insert(f)}`:(await e.update(Number(s),f),`已更新记忆 ${s}`)}catch(f){throw new Error(`记忆操作失败: ${f}`)}}}),searchMemory:fs({name:"search_memory",description:"搜索长期记忆中的相关信息,帮助维护对话上下文",parameters:[{name:"query",type:"string",description:"请使用中文关键词进行搜索"},{name:"tags",type:"string[]",description:"记忆标签",required:!1},{name:"path",type:"string",description:"记忆路径,memory://user_id/path/to/memory_name",required:!1},{name:"limit",type:"number",description:"返回结果的最大数量(默认10)",required:!1}],handler:async t=>{const{query:n,limit:r=10,tags:s,path:l}=t;if(!n||typeof n=="string"&&n.trim().length===0)throw new Error("搜索查询不能为空");try{const o=await e.query(n.toString(),{limit:r});return{query:n.toString(),results:o,total:o.length,limit:Number(r)}}catch(o){throw new Error(`搜索记忆失败: ${o}`)}}})}),jg=(e,t)=>t.some(n=>e instanceof n);let r1,i1;function wz(){return r1||(r1=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function _z(){return i1||(i1=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const zg=new WeakMap,ep=new WeakMap,qc=new WeakMap;function Sz(e){const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("success",l),e.removeEventListener("error",o)},l=()=>{n(Wi(e.result)),s()},o=()=>{r(e.error),s()};e.addEventListener("success",l),e.addEventListener("error",o)});return qc.set(t,e),t}function kz(e){if(zg.has(e))return;const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("complete",l),e.removeEventListener("error",o),e.removeEventListener("abort",o)},l=()=>{n(),s()},o=()=>{r(e.error||new DOMException("AbortError","AbortError")),s()};e.addEventListener("complete",l),e.addEventListener("error",o),e.addEventListener("abort",o)});zg.set(e,t)}let Lg={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return zg.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Wi(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function QS(e){Lg=e(Lg)}function Ez(e){return _z().includes(e)?function(...t){return e.apply(Ig(this),t),Wi(this.request)}:function(...t){return Wi(e.apply(Ig(this),t))}}function Az(e){return typeof e=="function"?Ez(e):(e instanceof IDBTransaction&&kz(e),jg(e,wz())?new Proxy(e,Lg):e)}function Wi(e){if(e instanceof IDBRequest)return Sz(e);if(ep.has(e))return ep.get(e);const t=Az(e);return t!==e&&(ep.set(e,t),qc.set(t,e)),t}const Ig=e=>qc.get(e);function Tz(e,t,{blocked:n,upgrade:r,blocking:s,terminated:l}={}){const o=indexedDB.open(e,t),c=Wi(o);return r&&o.addEventListener("upgradeneeded",f=>{r(Wi(o.result),f.oldVersion,f.newVersion,Wi(o.transaction),f)}),n&&o.addEventListener("blocked",f=>n(f.oldVersion,f.newVersion,f)),c.then(f=>{l&&f.addEventListener("close",()=>l()),s&&f.addEventListener("versionchange",d=>s(d.oldVersion,d.newVersion,d))}).catch(()=>{}),c}const Cz=["get","getKey","getAll","getAllKeys","count"],Nz=["put","add","delete","clear"],tp=new Map;function a1(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(tp.get(t))return tp.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=Nz.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||Cz.includes(n)))return;const l=async function(o,...c){const f=this.transaction(o,s?"readwrite":"readonly");let d=f.store;return r&&(d=d.index(c.shift())),(await Promise.all([d[n](...c),s&&f.done]))[0]};return tp.set(t,l),l}QS(e=>({...e,get:(t,n,r)=>a1(t,n)||e.get(t,n,r),has:(t,n)=>!!a1(t,n)||e.has(t,n)}));const Oz=["continue","continuePrimaryKey","advance"],s1={},Bg=new WeakMap,KS=new WeakMap,Mz={get(e,t){if(!Oz.includes(t))return e[t];let n=s1[t];return n||(n=s1[t]=function(...r){Bg.set(this,KS.get(this)[t](...r))}),n}};async function*Rz(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const n=new Proxy(t,Mz);for(KS.set(n,t),qc.set(n,Ig(t));t;)yield n,t=await(Bg.get(n)||t.continue()),Bg.delete(n)}function l1(e,t){return t===Symbol.asyncIterator&&jg(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&jg(e,[IDBIndex,IDBObjectStore])}QS(e=>({...e,get(t,n,r){return l1(t,n)?Rz:e.get(t,n,r)},has(t,n){return l1(t,n)||e.has(t,n)}}));class Dz{constructor(t){ut(this,"isInitialized",!1);ut(this,"config");this.config=t}}const jz="ENTRIES",JS="KEYS",WS="VALUES",Bt="";class np{constructor(t,n){const r=t._tree,s=Array.from(r.keys());this.set=t,this._type=n,this._path=s.length>0?[{node:r,keys:s}]:[]}next(){const t=this.dive();return this.backtrack(),t}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:t,keys:n}=Qa(this._path);if(Qa(n)===Bt)return{done:!1,value:this.result()};const r=t.get(Qa(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const t=Qa(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:t})=>Qa(t)).filter(t=>t!==Bt).join("")}value(){return Qa(this._path).node.get(Bt)}result(){switch(this._type){case WS:return this.value();case JS:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const Qa=e=>e[e.length-1],zz=(e,t,n)=>{const r=new Map;if(t===void 0)return r;const s=t.length+1,l=s+n,o=new Uint8Array(l*s).fill(n+1);for(let c=0;c<s;++c)o[c]=c;for(let c=1;c<l;++c)o[c*s]=c;return ek(e,t,n,r,o,1,s,""),r},ek=(e,t,n,r,s,l,o,c)=>{const f=l*o;e:for(const d of e.keys())if(d===Bt){const p=s[f-1];p<=n&&r.set(c,[e.get(d),p])}else{let p=l;for(let g=0;g<d.length;++g,++p){const m=d[g],b=o*p,x=b-o;let w=s[b];const _=Math.max(0,p-n-1),k=Math.min(o-1,p+n);for(let A=_;A<k;++A){const S=m!==t[A],O=s[x+A]+ +S,D=s[x+A+1]+1,M=s[b+A]+1,F=s[b+A+1]=Math.min(O,D,M);F<w&&(w=F)}if(w>n)continue e}ek(e.get(d),t,n,r,s,p,o,c+d)}};class xi{constructor(t=new Map,n=""){this._size=void 0,this._tree=t,this._prefix=n}atPrefix(t){if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");const[n,r]=_c(this._tree,t.slice(this._prefix.length));if(n===void 0){const[s,l]=km(r);for(const o of s.keys())if(o!==Bt&&o.startsWith(l)){const c=new Map;return c.set(o.slice(l.length),s.get(o)),new xi(c,t)}}return new xi(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(t){return this._size=void 0,Lz(this._tree,t)}entries(){return new np(this,jz)}forEach(t){for(const[n,r]of this)t(n,r,this)}fuzzyGet(t,n){return zz(this._tree,t,n)}get(t){const n=Fg(this._tree,t);return n!==void 0?n.get(Bt):void 0}has(t){const n=Fg(this._tree,t);return n!==void 0&&n.has(Bt)}keys(){return new np(this,JS)}set(t,n){if(typeof t!="string")throw new Error("key must be a string");return this._size=void 0,rp(this._tree,t).set(Bt,n),this}get size(){if(this._size)return this._size;this._size=0;const t=this.entries();for(;!t.next().done;)this._size+=1;return this._size}update(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=rp(this._tree,t);return r.set(Bt,n(r.get(Bt))),this}fetch(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=rp(this._tree,t);let s=r.get(Bt);return s===void 0&&r.set(Bt,s=n()),s}values(){return new np(this,WS)}[Symbol.iterator](){return this.entries()}static from(t){const n=new xi;for(const[r,s]of t)n.set(r,s);return n}static fromObject(t){return xi.from(Object.entries(t))}}const _c=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(const r of e.keys())if(r!==Bt&&t.startsWith(r))return n.push([e,r]),_c(e.get(r),t.slice(r.length),n);return n.push([e,t]),_c(void 0,"",n)},Fg=(e,t)=>{if(t.length===0||e==null)return e;for(const n of e.keys())if(n!==Bt&&t.startsWith(n))return Fg(e.get(n),t.slice(n.length))},rp=(e,t)=>{const n=t.length;e:for(let r=0;e&&r<n;){for(const l of e.keys())if(l!==Bt&&t[r]===l[0]){const o=Math.min(n-r,l.length);let c=1;for(;c<o&&t[r+c]===l[c];)++c;const f=e.get(l);if(c===l.length)e=f;else{const d=new Map;d.set(l.slice(c),f),e.set(t.slice(r,r+c),d),e.delete(l),e=d}r+=c;continue e}const s=new Map;return e.set(t.slice(r),s),s}return e},Lz=(e,t)=>{const[n,r]=_c(e,t);if(n!==void 0){if(n.delete(Bt),n.size===0)tk(r);else if(n.size===1){const[s,l]=n.entries().next().value;nk(r,s,l)}}},tk=e=>{if(e.length===0)return;const[t,n]=km(e);if(t.delete(n),t.size===0)tk(e.slice(0,-1));else if(t.size===1){const[r,s]=t.entries().next().value;r!==Bt&&nk(e.slice(0,-1),r,s)}},nk=(e,t,n)=>{if(e.length===0)return;const[r,s]=km(e);r.set(s+t,n),r.delete(s)},km=e=>e[e.length-1],Em="or",rk="and",Iz="and_not";class ea{constructor(t){if((t==null?void 0:t.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');const n=t.autoVacuum==null||t.autoVacuum===!0?sp:t.autoVacuum;this._options={...ap,...t,autoVacuum:n,searchOptions:{...o1,...t.searchOptions||{}},autoSuggestOptions:{...Hz,...t.autoSuggestOptions||{}}},this._index=new xi,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=Ug,this.addFields(this._options.fields)}add(t){const{extractField:n,tokenize:r,processTerm:s,fields:l,idField:o}=this._options,c=n(t,o);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${o}"`);if(this._idToShortId.has(c))throw new Error(`MiniSearch: duplicate ID ${c}`);const f=this.addDocumentId(c);this.saveStoredFields(f,t);for(const d of l){const p=n(t,d);if(p==null)continue;const g=r(p.toString(),d),m=this._fieldIds[d],b=new Set(g).size;this.addFieldLength(f,m,this._documentCount-1,b);for(const x of g){const w=s(x,d);if(Array.isArray(w))for(const _ of w)this.addTerm(m,f,_);else w&&this.addTerm(m,f,w)}}}addAll(t){for(const n of t)this.add(n)}addAllAsync(t,n={}){const{chunkSize:r=10}=n,s={chunk:[],promise:Promise.resolve()},{chunk:l,promise:o}=t.reduce(({chunk:c,promise:f},d,p)=>(c.push(d),(p+1)%r===0?{chunk:[],promise:f.then(()=>new Promise(g=>setTimeout(g,0))).then(()=>this.addAll(c))}:{chunk:c,promise:f}),s);return o.then(()=>this.addAll(l))}remove(t){const{tokenize:n,processTerm:r,extractField:s,fields:l,idField:o}=this._options,c=s(t,o);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${o}"`);const f=this._idToShortId.get(c);if(f==null)throw new Error(`MiniSearch: cannot remove document with ID ${c}: it is not in the index`);for(const d of l){const p=s(t,d);if(p==null)continue;const g=n(p.toString(),d),m=this._fieldIds[d],b=new Set(g).size;this.removeFieldLength(f,m,this._documentCount,b);for(const x of g){const w=r(x,d);if(Array.isArray(w))for(const _ of w)this.removeTerm(m,f,_);else w&&this.removeTerm(m,f,w)}}this._storedFields.delete(f),this._documentIds.delete(f),this._idToShortId.delete(c),this._fieldLength.delete(f),this._documentCount-=1}removeAll(t){if(t)for(const n of t)this.remove(n);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new xi,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(t){const n=this._idToShortId.get(t);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${t}: it is not in the index`);this._idToShortId.delete(t),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((r,s)=>{this.removeFieldLength(n,s,this._documentCount,r)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:t,minDirtCount:n,batchSize:r,batchWait:s}=this._options.autoVacuum;this.conditionalVacuum({batchSize:r,batchWait:s},{minDirtCount:n,minDirtFactor:t})}discardAll(t){const n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const r of t)this.discard(r)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(t){const{idField:n,extractField:r}=this._options,s=r(t,n);this.discard(s),this.add(t)}vacuum(t={}){return this.conditionalVacuum(t)}conditionalVacuum(t,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const r=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=Ug,this.performVacuuming(t,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)}async performVacuuming(t,n){const r=this._dirtCount;if(this.vacuumConditionsMet(n)){const s=t.batchSize||Pg.batchSize,l=t.batchWait||Pg.batchWait;let o=1;for(const[c,f]of this._index){for(const[d,p]of f)for(const[g]of p)this._documentIds.has(g)||(p.size<=1?f.delete(d):p.delete(g));this._index.get(c).size===0&&this._index.delete(c),o%s===0&&await new Promise(d=>setTimeout(d,l)),o+=1}this._dirtCount-=r}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(t){if(t==null)return!0;let{minDirtCount:n,minDirtFactor:r}=t;return n=n||sp.minDirtCount,r=r||sp.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=r}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(t){return this._idToShortId.has(t)}getStoredFields(t){const n=this._idToShortId.get(t);if(n!=null)return this._storedFields.get(n)}search(t,n={}){const{searchOptions:r}=this._options,s={...r,...n},l=this.executeQuery(t,n),o=[];for(const[c,{score:f,terms:d,match:p}]of l){const g=d.length||1,m={id:this._documentIds.get(c),score:f*g,terms:Object.keys(p),queryTerms:d,match:p};Object.assign(m,this._storedFields.get(c)),(s.filter==null||s.filter(m))&&o.push(m)}return t===ea.wildcard&&s.boostDocument==null||o.sort(c1),o}autoSuggest(t,n={}){n={...this._options.autoSuggestOptions,...n};const r=new Map;for(const{score:l,terms:o}of this.search(t,n)){const c=o.join(" "),f=r.get(c);f!=null?(f.score+=l,f.count+=1):r.set(c,{score:l,terms:o,count:1})}const s=[];for(const[l,{score:o,terms:c,count:f}]of r)s.push({suggestion:l,terms:c,score:o/f});return s.sort(c1),s}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),n)}static async loadJSONAsync(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(t),n)}static getDefault(t){if(ap.hasOwnProperty(t))return ip(ap,t);throw new Error(`MiniSearch: unknown option "${t}"`)}static loadJS(t,n){const{index:r,documentIds:s,fieldLength:l,storedFields:o,serializationVersion:c}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=qu(s),f._fieldLength=qu(l),f._storedFields=qu(o);for(const[d,p]of f._documentIds)f._idToShortId.set(p,d);for(const[d,p]of r){const g=new Map;for(const m of Object.keys(p)){let b=p[m];c===1&&(b=b.ds),g.set(parseInt(m,10),qu(b))}f._index.set(d,g)}return f}static async loadJSAsync(t,n){const{index:r,documentIds:s,fieldLength:l,storedFields:o,serializationVersion:c}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=await Gu(s),f._fieldLength=await Gu(l),f._storedFields=await Gu(o);for(const[p,g]of f._documentIds)f._idToShortId.set(g,p);let d=0;for(const[p,g]of r){const m=new Map;for(const b of Object.keys(g)){let x=g[b];c===1&&(x=x.ds),m.set(parseInt(b,10),await Gu(x))}++d%1e3===0&&await ik(0),f._index.set(p,m)}return f}static instantiateMiniSearch(t,n){const{documentCount:r,nextId:s,fieldIds:l,averageFieldLength:o,dirtCount:c,serializationVersion:f}=t;if(f!==1&&f!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const d=new ea(n);return d._documentCount=r,d._nextId=s,d._idToShortId=new Map,d._fieldIds=l,d._avgFieldLength=o,d._dirtCount=c||0,d._index=new xi,d}executeQuery(t,n={}){if(t===ea.wildcard)return this.executeWildcardQuery(n);if(typeof t!="string"){const m={...n,...t,queries:void 0},b=t.queries.map(x=>this.executeQuery(x,m));return this.combineResults(b,m.combineWith)}const{tokenize:r,processTerm:s,searchOptions:l}=this._options,o={tokenize:r,processTerm:s,...l,...n},{tokenize:c,processTerm:f}=o,g=c(t).flatMap(m=>f(m)).filter(m=>!!m).map(Uz(o)).map(m=>this.executeQuerySpec(m,o));return this.combineResults(g,o.combineWith)}executeQuerySpec(t,n){const r={...this._options.searchOptions,...n},s=(r.fields||this._options.fields).reduce((w,_)=>({...w,[_]:ip(r.boost,_)||1}),{}),{boostDocument:l,weights:o,maxFuzzy:c,bm25:f}=r,{fuzzy:d,prefix:p}={...o1.weights,...o},g=this._index.get(t.term),m=this.termResults(t.term,t.term,1,t.termBoost,g,s,l,f);let b,x;if(t.prefix&&(b=this._index.atPrefix(t.term)),t.fuzzy){const w=t.fuzzy===!0?.2:t.fuzzy,_=w<1?Math.min(c,Math.round(t.term.length*w)):w;_&&(x=this._index.fuzzyGet(t.term,_))}if(b)for(const[w,_]of b){const k=w.length-t.term.length;if(!k)continue;x==null||x.delete(w);const A=p*w.length/(w.length+.3*k);this.termResults(t.term,w,A,t.termBoost,_,s,l,f,m)}if(x)for(const w of x.keys()){const[_,k]=x.get(w);if(!k)continue;const A=d*w.length/(w.length+k);this.termResults(t.term,w,A,t.termBoost,_,s,l,f,m)}return m}executeWildcardQuery(t){const n=new Map,r={...this._options.searchOptions,...t};for(const[s,l]of this._documentIds){const o=r.boostDocument?r.boostDocument(l,"",this._storedFields.get(s)):1;n.set(s,{score:o,terms:[],match:{}})}return n}combineResults(t,n=Em){if(t.length===0)return new Map;const r=n.toLowerCase(),s=Bz[r];if(!s)throw new Error(`Invalid combination operator: ${n}`);return t.reduce(s)||new Map}toJSON(){const t=[];for(const[n,r]of this._index){const s={};for(const[l,o]of r)s[l]=Object.fromEntries(o);t.push([n,s])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:t,serializationVersion:2}}termResults(t,n,r,s,l,o,c,f,d=new Map){if(l==null)return d;for(const p of Object.keys(o)){const g=o[p],m=this._fieldIds[p],b=l.get(m);if(b==null)continue;let x=b.size;const w=this._avgFieldLength[m];for(const _ of b.keys()){if(!this._documentIds.has(_)){this.removeTerm(m,_,n),x-=1;continue}const k=c?c(this._documentIds.get(_),n,this._storedFields.get(_)):1;if(!k)continue;const A=b.get(_),S=this._fieldLength.get(_)[m],O=Pz(A,x,this._documentCount,S,w,f),D=r*s*g*k*O,M=d.get(_);if(M){M.score+=D,$z(M.terms,t);const F=ip(M.match,n);F?F.push(p):M.match[n]=[p]}else d.set(_,{score:D,terms:[t],match:{[n]:[p]}})}}return d}addTerm(t,n,r){const s=this._index.fetch(r,f1);let l=s.get(t);if(l==null)l=new Map,l.set(n,1),s.set(t,l);else{const o=l.get(n);l.set(n,(o||0)+1)}}removeTerm(t,n,r){if(!this._index.has(r)){this.warnDocumentChanged(n,t,r);return}const s=this._index.fetch(r,f1),l=s.get(t);l==null||l.get(n)==null?this.warnDocumentChanged(n,t,r):l.get(n)<=1?l.size<=1?s.delete(t):l.delete(n):l.set(n,l.get(n)-1),this._index.get(r).size===0&&this._index.delete(r)}warnDocumentChanged(t,n,r){for(const s of Object.keys(this._fieldIds))if(this._fieldIds[s]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(t)} has changed before removal: term "${r}" was not present in field "${s}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(t){const n=this._nextId;return this._idToShortId.set(t,n),this._documentIds.set(n,t),this._documentCount+=1,this._nextId+=1,n}addFields(t){for(let n=0;n<t.length;n++)this._fieldIds[t[n]]=n}addFieldLength(t,n,r,s){let l=this._fieldLength.get(t);l==null&&this._fieldLength.set(t,l=[]),l[n]=s;const c=(this._avgFieldLength[n]||0)*r+s;this._avgFieldLength[n]=c/(r+1)}removeFieldLength(t,n,r,s){if(r===1){this._avgFieldLength[n]=0;return}const l=this._avgFieldLength[n]*r-s;this._avgFieldLength[n]=l/(r-1)}saveStoredFields(t,n){const{storeFields:r,extractField:s}=this._options;if(r==null||r.length===0)return;let l=this._storedFields.get(t);l==null&&this._storedFields.set(t,l={});for(const o of r){const c=s(n,o);c!==void 0&&(l[o]=c)}}}ea.wildcard=Symbol("*");const ip=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,Bz={[Em]:(e,t)=>{for(const n of t.keys()){const r=e.get(n);if(r==null)e.set(n,t.get(n));else{const{score:s,terms:l,match:o}=t.get(n);r.score=r.score+s,r.match=Object.assign(r.match,o),u1(r.terms,l)}}return e},[rk]:(e,t)=>{const n=new Map;for(const r of t.keys()){const s=e.get(r);if(s==null)continue;const{score:l,terms:o,match:c}=t.get(r);u1(s.terms,o),n.set(r,{score:s.score+l,terms:s.terms,match:Object.assign(s.match,c)})}return n},[Iz]:(e,t)=>{for(const n of t.keys())e.delete(n);return e}},Fz={k:1.2,b:.7,d:.5},Pz=(e,t,n,r,s,l)=>{const{k:o,b:c,d:f}=l;return Math.log(1+(n-t+.5)/(t+.5))*(f+e*(o+1)/(e+o*(1-c+c*r/s)))},Uz=e=>(t,n,r)=>{const s=typeof e.fuzzy=="function"?e.fuzzy(t,n,r):e.fuzzy||!1,l=typeof e.prefix=="function"?e.prefix(t,n,r):e.prefix===!0,o=typeof e.boostTerm=="function"?e.boostTerm(t,n,r):1;return{term:t,fuzzy:s,prefix:l,termBoost:o}},ap={idField:"id",extractField:(e,t)=>e[t],tokenize:e=>e.split(Vz),processTerm:e=>e.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(e,t)=>{typeof(console==null?void 0:console[e])=="function"&&console[e](t)},autoVacuum:!0},o1={combineWith:Em,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Fz},Hz={combineWith:rk,prefix:(e,t,n)=>t===n.length-1},Pg={batchSize:1e3,batchWait:10},Ug={minDirtFactor:.1,minDirtCount:20},sp={...Pg,...Ug},$z=(e,t)=>{e.includes(t)||e.push(t)},u1=(e,t)=>{for(const n of t)e.includes(n)||e.push(n)},c1=({score:e},{score:t})=>t-e,f1=()=>new Map,qu=e=>{const t=new Map;for(const n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},Gu=async e=>{const t=new Map;let n=0;for(const r of Object.keys(e))t.set(parseInt(r,10),e[r]),++n%1e3===0&&await ik(0);return t},ik=e=>new Promise(t=>setTimeout(t,e)),Vz=/[\n\r\p{Z}\p{P}]+/u,d1={dbName:"minisearch_memory_db",dbVersion:1,storeName:"memory",miniSearchOptions:{fields:["text","path","tags","referencePath"],storeFields:["text","path","tags","referencePath"],tokenize:ak}};function ak(e){const t=e.replace(/ /g,""),n=new Intl.Segmenter("zh-CN",{granularity:"word"});return Array.from(n.segment(t)).map(s=>s.segment)}class qz extends Dz{constructor(n){const r={...d1,...n,miniSearchOptions:{...d1.miniSearchOptions,...(n==null?void 0:n.miniSearchOptions)||{}}};super(r);ut(this,"miniSearch");ut(this,"config");ut(this,"db");this.config=r}async initialize(){if(this.isInitialized)return;const{storeName:n}=this.config;this.db=await Tz(this.config.dbName,this.config.dbVersion,{upgrade(s){s.objectStoreNames.contains(n)||s.createObjectStore(n,{keyPath:"id",autoIncrement:!0}),s.objectStoreNames.contains("minisearch_index")||s.createObjectStore("minisearch_index")}});const r={fields:this.config.miniSearchOptions.fields||["text"],storeFields:this.config.miniSearchOptions.storeFields||["text"],tokenize:this.config.miniSearchOptions.tokenize||ak};this.miniSearch=new ea(r);try{const s=await this.loadMiniSearchIndex();if(s)console.log(s),this.miniSearch=await ea.loadJSAsync(s,r),console.log("MiniSearch index loaded from IndexedDB.");else{console.log("No saved index found, building from documents...");const l=await this.getAll();l.length>0?(this.miniSearch.addAll(l),await this.saveMiniSearchIndex(this.miniSearch.toJSON()),console.log(`MiniSearch index built from ${l.length} documents and saved.`)):console.log("No documents found, index is empty.")}this.isInitialized=!0}catch(s){throw console.error("Failed to initialize FullTextSearchService:",s),s}}async insert(n){const r=this.db.transaction(this.config.storeName,"readwrite"),s=r.objectStore(this.config.storeName),l={...n},o=await s.add(l);return l.id=Number(o),await r.done,this.miniSearch.add(l),await this.saveMiniSearchIndex(this.miniSearch.toJSON()),l.id}async update(n,r){const l=this.db.transaction(this.config.storeName,"readwrite").objectStore(this.config.storeName),o={...r,id:n};await l.put(o);const c=await l.get(n);c&&this.miniSearch.remove(c),this.miniSearch.add(o),await this.saveMiniSearchIndex(this.miniSearch.toJSON())}async delete(n){const s=this.db.transaction(this.config.storeName,"readwrite").objectStore(this.config.storeName),l=await s.get(n);l&&this.miniSearch.remove(l),await s.delete(n),await this.saveMiniSearchIndex(this.miniSearch.toJSON())}async query(n,r){return this.miniSearch.search(n,r).slice(0,(r==null?void 0:r.limit)??5).map(l=>{const{id:o,text:c,...f}=l;return{id:o,text:c,tags:f.tags,path:f.path,type:f.type,score:Math.round(l.score),referencePath:f.referencePath}})}async get(n){return this.db.transaction(this.config.storeName,"readonly").objectStore(this.config.storeName).get(n)}async getAll(){return this.db.transaction(this.config.storeName,"readonly").objectStore(this.config.storeName).getAll()}async loadMiniSearchIndex(){return this.db.transaction("minisearch_index","readonly").objectStore("minisearch_index").get("indexData")}async saveMiniSearchIndex(n){const r=this.db.transaction("minisearch_index","readwrite");await r.objectStore("minisearch_index").put(n,"indexData"),await r.done}}const sk=W.createContext({artifacts:[],currentArtifact:null,setCurrentArtifactById:()=>{},getArtifactVersions:()=>[],showArtifact:!1,setShowArtifact:()=>{}}),Gc=()=>W.useContext(sk),Gz=({children:e})=>{const[t,n]=W.useState([]),[r,s]=W.useState(!1),{renderMessages:l}=oa(),[o,c]=W.useState(null),f=p=>t.filter(g=>g.filename===p).sort((g,m)=>g.version-m.version);W.useEffect(()=>{if(!l)return;const p=l.filter(b=>b.type==="tool").filter(b=>b.name==="create_artifacts"),g=new Map,m=p.map(b=>{const x=JSON.parse(b.tool_input),w=x.filename,k=(g.get(w)||0)+1;return g.set(w,k),{id:b.id,code:x.code,filename:w,version:k,filetype:x.filetype}});n(m)},[l]);const d=p=>{s(!0),c(t.find(g=>g.id===p)||null)};return C.jsx(sk.Provider,{value:{artifacts:t,currentArtifact:o,setCurrentArtifactById:d,getArtifactVersions:f,showArtifact:r,setShowArtifact:s},children:e})},Zz=fs({name:"create_artifacts",description:"创建并保存代码文件到 artifacts 目录",parameters:[],onlyRender:!0,render(e){const t=e.getInputRepaired(),{setCurrentArtifactById:n,currentArtifact:r}=Gc(),s=()=>{n(e.message.id)};return C.jsxs("div",{className:"p-4 space-y-4",children:[C.jsxs("div",{className:"text-sm text-gray-500",children:["创建文件: ",t.filename,".",t.filetype]}),C.jsx("div",{className:"border rounded-lg p-2 hover:bg-gray-50",children:C.jsxs("div",{className:"flex items-center justify-between select-none cursor-pointer",onClick:s,children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx(X3,{className:"w-4 h-4"}),C.jsx("span",{className:"font-xs",children:t.filename})]}),C.jsxs("span",{className:"text-gray-400",children:[t.filetype," ",(r==null?void 0:r.id)===e.message.id?"▼":"▶"]})]})})]})}}),Yz=localStorage.getItem("withCredentials")==="true"?(e,t)=>(t.credentials="include",fetch(e,t)):fetch,Xz=()=>({showHistory:localStorage.getItem("showHistory")==="true"||!1,showGraph:localStorage.getItem("showGraph")==="true"||!1}),h1=e=>{Object.entries(e).forEach(([t,n])=>{localStorage.setItem(t,n.toString())})},Am=new qz({dbName:"memory_fulltext_db",dbVersion:1,storeName:"memory"});Am.initialize();console.log(Am);const p1=xz(Am),Qz=UN(localStorage.getItem("agent_name")||"",{apiUrl:localStorage.getItem("apiUrl")||"http://localhost:8123",defaultHeaders:JSON.parse(localStorage.getItem("code")||"{}"),callerOptions:{fetch:Yz}},{...Xz(),onInit(e){e.tools.bindTools([Zz,yz,gz,mz,p1.manageMemory,p1.searchMemory])}});let lp=(e,t)=>n=>{e.current!==n&&(e.current=n,t())};function Kz(e,{keys:t,deps:n=[e,t]}={}){let r=W.useRef();r.current=e.get();let s=W.useCallback(o=>(lp(r,o)(e.value),(t==null?void 0:t.length)>0?LN(e,t,lp(r,o)):e.listen(lp(r,o))),n),l=()=>r.current;return W.useSyncExternalStore(s,l,l)}const lk=W.createContext(void 0),oa=()=>{const e=W.useContext(lk);if(!e)throw new Error("useChat must be used within a ChatProvider");return e},Jz=({children:e})=>{const t=oO(Qz,Kz);return W.useEffect(()=>{t.initClient().then(n=>{t.showHistory&&t.refreshHistoryList(),console.log(n)}).catch(n=>{console.error(n);const r=prompt("Failed to initialize chat client: "+t.currentAgent+`
|
|
209
|
-
请输入 agent 名称`);localStorage.setItem("agent_name",r),location.reload()})},[]),C.jsx(lk.Provider,{value:t,children:e})};function ok(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=ok(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function uk(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=ok(e))&&(r&&(r+=" "),r+=t);return r}var Wz=Object.create,Zc=Object.defineProperty,e5=Object.defineProperties,t5=Object.getOwnPropertyDescriptor,n5=Object.getOwnPropertyDescriptors,ck=Object.getOwnPropertyNames,Sc=Object.getOwnPropertySymbols,r5=Object.getPrototypeOf,Tm=Object.prototype.hasOwnProperty,fk=Object.prototype.propertyIsEnumerable,g1=(e,t,n)=>t in e?Zc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sr=(e,t)=>{for(var n in t||(t={}))Tm.call(t,n)&&g1(e,n,t[n]);if(Sc)for(var n of Sc(t))fk.call(t,n)&&g1(e,n,t[n]);return e},Yc=(e,t)=>e5(e,n5(t)),dk=(e,t)=>{var n={};for(var r in e)Tm.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Sc)for(var r of Sc(e))t.indexOf(r)<0&&fk.call(e,r)&&(n[r]=e[r]);return n},i5=(e,t)=>function(){return t||(0,e[ck(e)[0]])((t={exports:{}}).exports,t),t.exports},a5=(e,t)=>{for(var n in t)Zc(e,n,{get:t[n],enumerable:!0})},s5=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ck(t))!Tm.call(e,s)&&s!==n&&Zc(e,s,{get:()=>t[s],enumerable:!(r=t5(t,s))||r.enumerable});return e},l5=(e,t,n)=>(n=e!=null?Wz(r5(e)):{},s5(!e||!e.__esModule?Zc(n,"default",{value:e,enumerable:!0}):n,e)),o5=i5({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,t){var n=function(){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,s=0,l={},o={util:{encode:function x(w){return w instanceof c?new c(w.type,x(w.content),w.alias):Array.isArray(w)?w.map(x):w.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(x){return Object.prototype.toString.call(x).slice(8,-1)},objId:function(x){return x.__id||Object.defineProperty(x,"__id",{value:++s}),x.__id},clone:function x(w,_){_=_||{};var k,A;switch(o.util.type(w)){case"Object":if(A=o.util.objId(w),_[A])return _[A];k={},_[A]=k;for(var S in w)w.hasOwnProperty(S)&&(k[S]=x(w[S],_));return k;case"Array":return A=o.util.objId(w),_[A]?_[A]:(k=[],_[A]=k,w.forEach(function(O,D){k[D]=x(O,_)}),k);default:return w}},getLanguage:function(x){for(;x;){var w=r.exec(x.className);if(w)return w[1].toLowerCase();x=x.parentElement}return"none"},setLanguage:function(x,w){x.className=x.className.replace(RegExp(r,"gi"),""),x.classList.add("language-"+w)},isActive:function(x,w,_){for(var k="no-"+w;x;){var A=x.classList;if(A.contains(w))return!0;if(A.contains(k))return!1;x=x.parentElement}return!!_}},languages:{plain:l,plaintext:l,text:l,txt:l,extend:function(x,w){var _=o.util.clone(o.languages[x]);for(var k in w)_[k]=w[k];return _},insertBefore:function(x,w,_,k){k=k||o.languages;var A=k[x],S={};for(var O in A)if(A.hasOwnProperty(O)){if(O==w)for(var D in _)_.hasOwnProperty(D)&&(S[D]=_[D]);_.hasOwnProperty(O)||(S[O]=A[O])}var M=k[x];return k[x]=S,o.languages.DFS(o.languages,function(F,L){L===M&&F!=x&&(this[F]=S)}),S},DFS:function x(w,_,k,A){A=A||{};var S=o.util.objId;for(var O in w)if(w.hasOwnProperty(O)){_.call(w,O,w[O],k||O);var D=w[O],M=o.util.type(D);M==="Object"&&!A[S(D)]?(A[S(D)]=!0,x(D,_,null,A)):M==="Array"&&!A[S(D)]&&(A[S(D)]=!0,x(D,_,O,A))}}},plugins:{},highlight:function(x,w,_){var k={code:x,grammar:w,language:_};if(o.hooks.run("before-tokenize",k),!k.grammar)throw new Error('The language "'+k.language+'" has no grammar.');return k.tokens=o.tokenize(k.code,k.grammar),o.hooks.run("after-tokenize",k),c.stringify(o.util.encode(k.tokens),k.language)},tokenize:function(x,w){var _=w.rest;if(_){for(var k in _)w[k]=_[k];delete w.rest}var A=new p;return g(A,A.head,x),d(x,A,w,A.head,0),b(A)},hooks:{all:{},add:function(x,w){var _=o.hooks.all;_[x]=_[x]||[],_[x].push(w)},run:function(x,w){var _=o.hooks.all[x];if(!(!_||!_.length))for(var k=0,A;A=_[k++];)A(w)}},Token:c};function c(x,w,_,k){this.type=x,this.content=w,this.alias=_,this.length=(k||"").length|0}c.stringify=function x(w,_){if(typeof w=="string")return w;if(Array.isArray(w)){var k="";return w.forEach(function(M){k+=x(M,_)}),k}var A={type:w.type,content:x(w.content,_),tag:"span",classes:["token",w.type],attributes:{},language:_},S=w.alias;S&&(Array.isArray(S)?Array.prototype.push.apply(A.classes,S):A.classes.push(S)),o.hooks.run("wrap",A);var O="";for(var D in A.attributes)O+=" "+D+'="'+(A.attributes[D]||"").replace(/"/g,""")+'"';return"<"+A.tag+' class="'+A.classes.join(" ")+'"'+O+">"+A.content+"</"+A.tag+">"};function f(x,w,_,k){x.lastIndex=w;var A=x.exec(_);if(A&&k&&A[1]){var S=A[1].length;A.index+=S,A[0]=A[0].slice(S)}return A}function d(x,w,_,k,A,S){for(var O in _)if(!(!_.hasOwnProperty(O)||!_[O])){var D=_[O];D=Array.isArray(D)?D:[D];for(var M=0;M<D.length;++M){if(S&&S.cause==O+","+M)return;var F=D[M],L=F.inside,U=!!F.lookbehind,j=!!F.greedy,H=F.alias;if(j&&!F.pattern.global){var B=F.pattern.toString().match(/[imsuy]*$/)[0];F.pattern=RegExp(F.pattern.source,B+"g")}for(var q=F.pattern||F,R=k.next,$=A;R!==w.tail&&!(S&&$>=S.reach);$+=R.value.length,R=R.next){var I=R.value;if(w.length>x.length)return;if(!(I instanceof c)){var P=1,Y;if(j){if(Y=f(q,$,x,U),!Y||Y.index>=x.length)break;var te=Y.index,X=Y.index+Y[0].length,E=$;for(E+=R.value.length;te>=E;)R=R.next,E+=R.value.length;if(E-=R.value.length,$=E,R.value instanceof c)continue;for(var G=R;G!==w.tail&&(E<X||typeof G.value=="string");G=G.next)P++,E+=G.value.length;P--,I=x.slice($,E),Y.index-=$}else if(Y=f(q,0,I,U),!Y)continue;var te=Y.index,T=Y[0],V=I.slice(0,te),K=I.slice(te+T.length),J=$+I.length;S&&J>S.reach&&(S.reach=J);var le=R.prev;V&&(le=g(w,le,V),$+=V.length),m(w,le,P);var fe=new c(O,L?o.tokenize(T,L):T,H,T);if(R=g(w,le,fe),K&&g(w,R,K),P>1){var ye={cause:O+","+M,reach:J};d(x,w,_,R.prev,$,ye),S&&ye.reach>S.reach&&(S.reach=ye.reach)}}}}}}function p(){var x={value:null,prev:null,next:null},w={value:null,prev:x,next:null};x.next=w,this.head=x,this.tail=w,this.length=0}function g(x,w,_){var k=w.next,A={value:_,prev:w,next:k};return w.next=A,k.prev=A,x.length++,A}function m(x,w,_){for(var k=w.next,A=0;A<_&&k!==x.tail;A++)k=k.next;w.next=k,k.prev=w,x.length-=A}function b(x){for(var w=[],_=x.head.next;_!==x.tail;)w.push(_.value),_=_.next;return w}return o}();t.exports=n,n.default=n}}),ce=l5(o5());ce.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},ce.languages.markup.tag.inside["attr-value"].inside.entity=ce.languages.markup.entity,ce.languages.markup.doctype.inside["internal-subset"].inside=ce.languages.markup,ce.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(ce.languages.markup.tag,"addInlined",{value:function(e,r){var n={},n=(n["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:ce.languages[r]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),r=(n["language-"+r]={pattern:/[\s\S]+/,inside:ce.languages[r]},{});r[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:n},ce.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(ce.languages.markup.tag,"addAttribute",{value:function(e,t){ce.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:ce.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),ce.languages.html=ce.languages.markup,ce.languages.mathml=ce.languages.markup,ce.languages.svg=ce.languages.markup,ce.languages.xml=ce.languages.extend("markup",{}),ce.languages.ssml=ce.languages.xml,ce.languages.atom=ce.languages.xml,ce.languages.rss=ce.languages.xml,function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+n.source+")",r=RegExp(r+"-"+r),s={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":t,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":s}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":s}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}}(ce),ce.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},ce.languages.javascript=ce.languages.extend("clike",{"class-name":[ce.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),ce.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,ce.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:ce.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:ce.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:ce.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:ce.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:ce.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),ce.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:ce.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),ce.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),ce.languages.markup&&(ce.languages.markup.tag.addInlined("script","javascript"),ce.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),ce.languages.js=ce.languages.javascript,ce.languages.actionscript=ce.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),ce.languages.actionscript["class-name"].alias="function",delete ce.languages.actionscript.parameter,delete ce.languages.actionscript["literal-property"],ce.languages.markup&&ce.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:ce.languages.markup}}),function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(ce),function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(t,"addSupport",{value:function(n,r){(n=typeof n=="string"?[n]:n).forEach(function(s){var l=function(g){g.inside||(g.inside={}),g.inside.rest=r},o="doc-comment";if(c=e.languages[s]){var c,f=c[o];if((f=f||(c=e.languages.insertBefore(s,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[o])instanceof RegExp&&(f=c[o]={pattern:f}),Array.isArray(f))for(var d=0,p=f.length;d<p;d++)f[d]instanceof RegExp&&(f[d]={pattern:f[d]}),l(f[d]);else l(f)}})}}),t.addSupport(["java","javascript","php"],t)}(ce),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,t=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))}(ce),function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,t=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+t.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[t,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,number:n})}(ce),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+n.source+")?)",s=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),l=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(c,f){f=(f||"").replace(/m/g,"")+"m";var d=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return c});return RegExp(d,f)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+s+"|"+l+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(l),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(ce),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(d){return d=d.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+d+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,s=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),l=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,o=(e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+s+l+"(?:"+s+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+s+l+")(?:"+s+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+s+")"+l+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+s+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(d){["url","bold","italic","strike","code-snippet"].forEach(function(p){d!==p&&(e.languages.markdown[d].inside.content.inside[p]=e.languages.markdown[p])})}),e.hooks.add("after-tokenize",function(d){d.language!=="markdown"&&d.language!=="md"||function p(g){if(g&&typeof g!="string")for(var m=0,b=g.length;m<b;m++){var x,w=g[m];w.type!=="code"?p(w.content):(x=w.content[1],w=w.content[3],x&&w&&x.type==="code-language"&&w.type==="code-block"&&typeof x.content=="string"&&(x=x.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),x="language-"+(x=(/[a-z][\w-]*/i.exec(x)||[""])[0].toLowerCase()),w.alias?typeof w.alias=="string"?w.alias=[w.alias,x]:w.alias.push(x):w.alias=[x]))}}(d.tokens)}),e.hooks.add("wrap",function(d){if(d.type==="code-block"){for(var p="",g=0,m=d.classes.length;g<m;g++){var b=d.classes[g],b=/language-(.+)/.exec(b);if(b){p=b[1];break}}var x,w=e.languages[p];w?d.content=e.highlight(function(_){return _=_.replace(o,""),_=_.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(k,A){var S;return(A=A.toLowerCase())[0]==="#"?(S=A[1]==="x"?parseInt(A.slice(2),16):Number(A.slice(1)),f(S)):c[A]||k})}(d.content),w,p):p&&p!=="none"&&e.plugins.autoloader&&(x="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),d.attributes.id=x,e.plugins.autoloader.loadLanguages(p,function(){var _=document.getElementById(x);_&&(_.innerHTML=e.highlight(_.textContent,e.languages[p],p))}))}}),RegExp(e.languages.markup.tag.pattern.source,"gi")),c={amp:"&",lt:"<",gt:">",quot:'"'},f=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(ce),ce.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:ce.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},ce.hooks.add("after-tokenize",function(e){if(e.language==="graphql")for(var t=e.tokens.filter(function(x){return typeof x!="string"&&x.type!=="comment"&&x.type!=="scalar"}),n=0;n<t.length;){var r=t[n++];if(r.type==="keyword"&&r.content==="mutation"){var s=[];if(g(["definition-mutation","punctuation"])&&p(1).content==="("){n+=2;var l=m(/^\($/,/^\)$/);if(l===-1)continue;for(;n<l;n++){var o=p(0);o.type==="variable"&&(b(o,"variable-input"),s.push(o.content))}n=l+1}if(g(["punctuation","property-query"])&&p(0).content==="{"&&(n++,b(p(0),"property-mutation"),0<s.length)){var c=m(/^\{$/,/^\}$/);if(c!==-1)for(var f=n;f<c;f++){var d=t[f];d.type==="variable"&&0<=s.indexOf(d.content)&&b(d,"variable-input")}}}}function p(x){return t[n+x]}function g(x,w){w=w||0;for(var _=0;_<x.length;_++){var k=p(_+w);if(!k||k.type!==x[_])return}return 1}function m(x,w){for(var _=1,k=n;k<t.length;k++){var A=t[k],S=A.content;if(A.type==="punctuation"&&typeof S=="string"){if(x.test(S))_++;else if(w.test(S)&&--_===0)return k}}return-1}function b(x,w){var _=x.alias;_?Array.isArray(_)||(x.alias=_=[_]):x.alias=_=[],_.push(w)}}),ce.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,s=r.inside["interpolation-punctuation"],l=r.pattern.source;function o(g,m){if(e.languages[g])return{pattern:RegExp("((?:"+m+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:g}}}}function c(g,m,b){return g={code:g,grammar:m,language:b},e.hooks.run("before-tokenize",g),g.tokens=e.tokenize(g.code,g.grammar),e.hooks.run("after-tokenize",g),g.tokens}function f(g,m,b){var _=e.tokenize(g,{interpolation:{pattern:RegExp(l),lookbehind:!0}}),x=0,w={},_=c(_.map(function(A){if(typeof A=="string")return A;for(var S,O,A=A.content;g.indexOf((O=x++,S="___"+b.toUpperCase()+"_"+O+"___"))!==-1;);return w[S]=A,S}).join(""),m,b),k=Object.keys(w);return x=0,function A(S){for(var O=0;O<S.length;O++){if(x>=k.length)return;var D,M,F,L,U,j,H,B=S[O];typeof B=="string"||typeof B.content=="string"?(D=k[x],(H=(j=typeof B=="string"?B:B.content).indexOf(D))!==-1&&(++x,M=j.substring(0,H),U=w[D],F=void 0,(L={})["interpolation-punctuation"]=s,(L=e.tokenize(U,L)).length===3&&((F=[1,1]).push.apply(F,c(L[1],e.languages.javascript,"javascript")),L.splice.apply(L,F)),F=new e.Token("interpolation",L,r.alias,U),L=j.substring(H+D.length),U=[],M&&U.push(M),U.push(F),L&&(A(j=[L]),U.push.apply(U,j)),typeof B=="string"?(S.splice.apply(S,[O,1].concat(U)),O+=U.length-1):B.content=U)):(H=B.content,Array.isArray(H)?A(H):A([H]))}}(_),new e.Token(b,_,"language-"+b,g)}e.languages.javascript["template-string"]=[o("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),o("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),o("svg",/\bsvg/.source),o("markdown",/\b(?:markdown|md)/.source),o("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),o("sql",/\bsql/.source),t].filter(Boolean);var d={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function p(g){return typeof g=="string"?g:Array.isArray(g)?g.map(p).join(""):p(g.content)}e.hooks.add("after-tokenize",function(g){g.language in d&&function m(b){for(var x=0,w=b.length;x<w;x++){var _,k,A,S=b[x];typeof S!="string"&&(_=S.content,Array.isArray(_)?S.type==="template-string"?(S=_[1],_.length===3&&typeof S!="string"&&S.type==="embedded-code"&&(k=p(S),S=S.alias,S=Array.isArray(S)?S[0]:S,A=e.languages[S])&&(_[1]=f(k,A,S))):m(_):typeof _!="string"&&m([_]))}}(g.tokens)})}(ce),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(ce),function(e){var t=e.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:t.string,number:t.number,boolean:t.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:t,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)}(ce),function(e){e.languages.flow=e.languages.extend("javascript",{}),e.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),e.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(ce),ce.languages.n4js=ce.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),ce.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),ce.languages.n4jsd=ce.languages.n4js,function(e){function t(o,c){return RegExp(o.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),c)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var l=n[r],s=e.languages.javascript[l],l=(s=e.util.type(s)==="RegExp"?e.languages.javascript[l]={pattern:s}:s).inside||{};(s.inside=l)["maybe-class-name"]=/^[A-Z][\s\S]*/}}(ce),function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,s=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function l(f,d){return f=f.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return s}),RegExp(f,d)}s=l(s).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=l(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:l(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:l(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);function o(f){for(var d=[],p=0;p<f.length;p++){var g=f[p],m=!1;typeof g!="string"&&(g.type==="tag"&&g.content[0]&&g.content[0].type==="tag"?g.content[0].content[0].content==="</"?0<d.length&&d[d.length-1].tagName===c(g.content[0].content[1])&&d.pop():g.content[g.content.length-1].content!=="/>"&&d.push({tagName:c(g.content[0].content[1]),openedBraces:0}):0<d.length&&g.type==="punctuation"&&g.content==="{"?d[d.length-1].openedBraces++:0<d.length&&0<d[d.length-1].openedBraces&&g.type==="punctuation"&&g.content==="}"?d[d.length-1].openedBraces--:m=!0),(m||typeof g=="string")&&0<d.length&&d[d.length-1].openedBraces===0&&(m=c(g),p<f.length-1&&(typeof f[p+1]=="string"||f[p+1].type==="plain-text")&&(m+=c(f[p+1]),f.splice(p+1,1)),0<p&&(typeof f[p-1]=="string"||f[p-1].type==="plain-text")&&(m=c(f[p-1])+m,f.splice(p-1,1),p--),f[p]=new e.Token("plain-text",m,null,m)),g.content&&typeof g.content!="string"&&o(g.content)}}var c=function(f){return f?typeof f=="string"?f:typeof f.content=="string"?f.content:f.content.map(c).join(""):""};e.hooks.add("after-tokenize",function(f){f.language!=="jsx"&&f.language!=="tsx"||o(f.tokens)})}(ce),function(e){var t=e.util.clone(e.languages.typescript),t=(e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"],e.languages.tsx.tag);t.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+t.pattern.source+")",t.pattern.flags),t.lookbehind=!0}(ce),ce.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},ce.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=ce.languages.swift}),function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(ce),ce.languages.c=ce.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),ce.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),ce.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},ce.languages.c.string],char:ce.languages.c.char,comment:ce.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:ce.languages.c}}}}),ce.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete ce.languages.c.boolean,ce.languages.objectivec=ce.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete ce.languages.objectivec["class-name"],ce.languages.objc=ce.languages.objectivec,ce.languages.reason=ce.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),ce.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete ce.languages.reason.function,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(ce),ce.languages.go=ce.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),ce.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete ce.languages.go["class-name"],function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(ce),ce.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},ce.languages.python["string-interpolation"].inside.interpolation.inside.rest=ce.languages.python,ce.languages.py=ce.languages.python,ce.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},ce.languages.webmanifest=ce.languages.json;var hk={};a5(hk,{dracula:()=>c5,duotoneDark:()=>d5,duotoneLight:()=>p5,github:()=>m5,gruvboxMaterialDark:()=>q5,gruvboxMaterialLight:()=>Z5,jettwaveDark:()=>I5,jettwaveLight:()=>F5,nightOwl:()=>b5,nightOwlLight:()=>x5,oceanicNext:()=>_5,okaidia:()=>k5,oneDark:()=>U5,oneLight:()=>$5,palenight:()=>A5,shadesOfPurple:()=>C5,synthwave84:()=>O5,ultramin:()=>R5,vsDark:()=>pk,vsLight:()=>z5});var u5={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},c5=u5,f5={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},d5=f5,h5={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},p5=h5,g5={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},m5=g5,y5={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},b5=y5,v5={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},x5=v5,yn={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},w5={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:yn.keyword}},{types:["attr-value"],style:{color:yn.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:yn.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:yn.primitive}},{types:["boolean"],style:{color:yn.boolean}},{types:["tag"],style:{color:yn.tag}},{types:["string"],style:{color:yn.string}},{types:["punctuation"],style:{color:yn.string}},{types:["selector","char","builtin","inserted"],style:{color:yn.char}},{types:["function"],style:{color:yn.function}},{types:["operator","entity","url","variable"],style:{color:yn.variable}},{types:["keyword"],style:{color:yn.keyword}},{types:["atrule","class-name"],style:{color:yn.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},_5=w5,S5={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},k5=S5,E5={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},A5=E5,T5={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},C5=T5,N5={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},O5=N5,M5={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},R5=M5,D5={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},pk=D5,j5={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},z5=j5,L5={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},I5=L5,B5={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},F5=B5,P5={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},U5=P5,H5={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},$5=H5,V5={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},q5=V5,G5={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},Z5=G5,Y5=e=>W.useCallback(t=>{var n=t,{className:r,style:s,line:l}=n,o=dk(n,["className","style","line"]);const c=Yc(sr({},o),{className:uk("token-line",r)});return typeof e=="object"&&"plain"in e&&(c.style=e.plain),typeof s=="object"&&(c.style=sr(sr({},c.style||{}),s)),c},[e]),X5=e=>{const t=W.useCallback(({types:n,empty:r})=>{if(e!=null){{if(n.length===1&&n[0]==="plain")return r!=null?{display:"inline-block"}:void 0;if(n.length===1&&r!=null)return e[n[0]]}return Object.assign(r!=null?{display:"inline-block"}:{},...n.map(s=>e[s]))}},[e]);return W.useCallback(n=>{var r=n,{token:s,className:l,style:o}=r,c=dk(r,["token","className","style"]);const f=Yc(sr({},c),{className:uk("token",...s.types,l),children:s.content,style:t(s)});return o!=null&&(f.style=sr(sr({},f.style||{}),o)),f},[t])},Q5=/\r\n|\r|\n/,m1=e=>{e.length===0?e.push({types:["plain"],content:`
|
|
208
|
+
`,parameters:[{name:"path",type:"string",description:"记忆路径(创建时需要)"},{name:"tags",type:"string[]",description:"记忆标签(创建或更新时需要)"},{name:"content",type:"string",description:"记忆内容(创建或更新时需要)"},{name:"action",type:"string",enum:["create","update","delete"],description:"操作类型:create(创建)、update(更新)、delete(删除)"},{name:"id",type:"string",description:"记忆ID(更新或删除时需要,创建时会自动生成)",required:!1},{name:"referencePath",type:"string",description:"引用文档的 URL",required:!1}],handler:async t=>{const{content:n,action:r,id:s,tags:l,path:o,referencePath:c}=t;if((r==="delete"||r==="update")&&!s)throw new Error("删除或更新记忆时必须提供记忆ID");if((r==="create"||r==="update")&&!n)throw new Error("创建或更新记忆时必须提供内容");try{if(r==="delete")return await e.delete(Number(s)),`已删除记忆 ${s}`;const f={text:n,content:vz(n),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),namespace:bz(),tags:l,path:o,type:"document",referencePath:c};return r==="create"?`已创建记忆 ${await e.insert(f)}`:(await e.update(Number(s),f),`已更新记忆 ${s}`)}catch(f){throw new Error(`记忆操作失败: ${f}`)}}}),searchMemory:fs({name:"search_memory",description:"搜索长期记忆中的相关信息,帮助维护对话上下文",parameters:[{name:"query",type:"string",description:"请使用中文关键词进行搜索"},{name:"tags",type:"string[]",description:"记忆标签",required:!1},{name:"path",type:"string",description:"记忆路径,memory://user_id/path/to/memory_name",required:!1},{name:"limit",type:"number",description:"返回结果的最大数量(默认10)",required:!1}],handler:async t=>{const{query:n,limit:r=10,tags:s,path:l}=t;if(!n||typeof n=="string"&&n.trim().length===0)throw new Error("搜索查询不能为空");try{const o=await e.query(n.toString(),{limit:r});return{query:n.toString(),results:o,total:o.length,limit:Number(r)}}catch(o){throw new Error(`搜索记忆失败: ${o}`)}}})}),jg=(e,t)=>t.some(n=>e instanceof n);let i1,a1;function wz(){return i1||(i1=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function _z(){return a1||(a1=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const zg=new WeakMap,ep=new WeakMap,qc=new WeakMap;function Sz(e){const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("success",l),e.removeEventListener("error",o)},l=()=>{n(Wi(e.result)),s()},o=()=>{r(e.error),s()};e.addEventListener("success",l),e.addEventListener("error",o)});return qc.set(t,e),t}function kz(e){if(zg.has(e))return;const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("complete",l),e.removeEventListener("error",o),e.removeEventListener("abort",o)},l=()=>{n(),s()},o=()=>{r(e.error||new DOMException("AbortError","AbortError")),s()};e.addEventListener("complete",l),e.addEventListener("error",o),e.addEventListener("abort",o)});zg.set(e,t)}let Lg={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return zg.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Wi(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function KS(e){Lg=e(Lg)}function Ez(e){return _z().includes(e)?function(...t){return e.apply(Ig(this),t),Wi(this.request)}:function(...t){return Wi(e.apply(Ig(this),t))}}function Az(e){return typeof e=="function"?Ez(e):(e instanceof IDBTransaction&&kz(e),jg(e,wz())?new Proxy(e,Lg):e)}function Wi(e){if(e instanceof IDBRequest)return Sz(e);if(ep.has(e))return ep.get(e);const t=Az(e);return t!==e&&(ep.set(e,t),qc.set(t,e)),t}const Ig=e=>qc.get(e);function Tz(e,t,{blocked:n,upgrade:r,blocking:s,terminated:l}={}){const o=indexedDB.open(e,t),c=Wi(o);return r&&o.addEventListener("upgradeneeded",f=>{r(Wi(o.result),f.oldVersion,f.newVersion,Wi(o.transaction),f)}),n&&o.addEventListener("blocked",f=>n(f.oldVersion,f.newVersion,f)),c.then(f=>{l&&f.addEventListener("close",()=>l()),s&&f.addEventListener("versionchange",d=>s(d.oldVersion,d.newVersion,d))}).catch(()=>{}),c}const Nz=["get","getKey","getAll","getAllKeys","count"],Cz=["put","add","delete","clear"],tp=new Map;function s1(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(tp.get(t))return tp.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=Cz.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||Nz.includes(n)))return;const l=async function(o,...c){const f=this.transaction(o,s?"readwrite":"readonly");let d=f.store;return r&&(d=d.index(c.shift())),(await Promise.all([d[n](...c),s&&f.done]))[0]};return tp.set(t,l),l}KS(e=>({...e,get:(t,n,r)=>s1(t,n)||e.get(t,n,r),has:(t,n)=>!!s1(t,n)||e.has(t,n)}));const Oz=["continue","continuePrimaryKey","advance"],l1={},Bg=new WeakMap,JS=new WeakMap,Mz={get(e,t){if(!Oz.includes(t))return e[t];let n=l1[t];return n||(n=l1[t]=function(...r){Bg.set(this,JS.get(this)[t](...r))}),n}};async function*Rz(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const n=new Proxy(t,Mz);for(JS.set(n,t),qc.set(n,Ig(t));t;)yield n,t=await(Bg.get(n)||t.continue()),Bg.delete(n)}function o1(e,t){return t===Symbol.asyncIterator&&jg(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&jg(e,[IDBIndex,IDBObjectStore])}KS(e=>({...e,get(t,n,r){return o1(t,n)?Rz:e.get(t,n,r)},has(t,n){return o1(t,n)||e.has(t,n)}}));class Dz{constructor(t){ut(this,"isInitialized",!1);ut(this,"config");this.config=t}}const jz="ENTRIES",WS="KEYS",ek="VALUES",Bt="";class np{constructor(t,n){const r=t._tree,s=Array.from(r.keys());this.set=t,this._type=n,this._path=s.length>0?[{node:r,keys:s}]:[]}next(){const t=this.dive();return this.backtrack(),t}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:t,keys:n}=Qa(this._path);if(Qa(n)===Bt)return{done:!1,value:this.result()};const r=t.get(Qa(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const t=Qa(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:t})=>Qa(t)).filter(t=>t!==Bt).join("")}value(){return Qa(this._path).node.get(Bt)}result(){switch(this._type){case ek:return this.value();case WS:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const Qa=e=>e[e.length-1],zz=(e,t,n)=>{const r=new Map;if(t===void 0)return r;const s=t.length+1,l=s+n,o=new Uint8Array(l*s).fill(n+1);for(let c=0;c<s;++c)o[c]=c;for(let c=1;c<l;++c)o[c*s]=c;return tk(e,t,n,r,o,1,s,""),r},tk=(e,t,n,r,s,l,o,c)=>{const f=l*o;e:for(const d of e.keys())if(d===Bt){const p=s[f-1];p<=n&&r.set(c,[e.get(d),p])}else{let p=l;for(let g=0;g<d.length;++g,++p){const m=d[g],b=o*p,x=b-o;let w=s[b];const _=Math.max(0,p-n-1),k=Math.min(o-1,p+n);for(let A=_;A<k;++A){const S=m!==t[A],O=s[x+A]+ +S,D=s[x+A+1]+1,M=s[b+A]+1,F=s[b+A+1]=Math.min(O,D,M);F<w&&(w=F)}if(w>n)continue e}tk(e.get(d),t,n,r,s,p,o,c+d)}};class xi{constructor(t=new Map,n=""){this._size=void 0,this._tree=t,this._prefix=n}atPrefix(t){if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");const[n,r]=_c(this._tree,t.slice(this._prefix.length));if(n===void 0){const[s,l]=km(r);for(const o of s.keys())if(o!==Bt&&o.startsWith(l)){const c=new Map;return c.set(o.slice(l.length),s.get(o)),new xi(c,t)}}return new xi(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(t){return this._size=void 0,Lz(this._tree,t)}entries(){return new np(this,jz)}forEach(t){for(const[n,r]of this)t(n,r,this)}fuzzyGet(t,n){return zz(this._tree,t,n)}get(t){const n=Fg(this._tree,t);return n!==void 0?n.get(Bt):void 0}has(t){const n=Fg(this._tree,t);return n!==void 0&&n.has(Bt)}keys(){return new np(this,WS)}set(t,n){if(typeof t!="string")throw new Error("key must be a string");return this._size=void 0,rp(this._tree,t).set(Bt,n),this}get size(){if(this._size)return this._size;this._size=0;const t=this.entries();for(;!t.next().done;)this._size+=1;return this._size}update(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=rp(this._tree,t);return r.set(Bt,n(r.get(Bt))),this}fetch(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=rp(this._tree,t);let s=r.get(Bt);return s===void 0&&r.set(Bt,s=n()),s}values(){return new np(this,ek)}[Symbol.iterator](){return this.entries()}static from(t){const n=new xi;for(const[r,s]of t)n.set(r,s);return n}static fromObject(t){return xi.from(Object.entries(t))}}const _c=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(const r of e.keys())if(r!==Bt&&t.startsWith(r))return n.push([e,r]),_c(e.get(r),t.slice(r.length),n);return n.push([e,t]),_c(void 0,"",n)},Fg=(e,t)=>{if(t.length===0||e==null)return e;for(const n of e.keys())if(n!==Bt&&t.startsWith(n))return Fg(e.get(n),t.slice(n.length))},rp=(e,t)=>{const n=t.length;e:for(let r=0;e&&r<n;){for(const l of e.keys())if(l!==Bt&&t[r]===l[0]){const o=Math.min(n-r,l.length);let c=1;for(;c<o&&t[r+c]===l[c];)++c;const f=e.get(l);if(c===l.length)e=f;else{const d=new Map;d.set(l.slice(c),f),e.set(t.slice(r,r+c),d),e.delete(l),e=d}r+=c;continue e}const s=new Map;return e.set(t.slice(r),s),s}return e},Lz=(e,t)=>{const[n,r]=_c(e,t);if(n!==void 0){if(n.delete(Bt),n.size===0)nk(r);else if(n.size===1){const[s,l]=n.entries().next().value;rk(r,s,l)}}},nk=e=>{if(e.length===0)return;const[t,n]=km(e);if(t.delete(n),t.size===0)nk(e.slice(0,-1));else if(t.size===1){const[r,s]=t.entries().next().value;r!==Bt&&rk(e.slice(0,-1),r,s)}},rk=(e,t,n)=>{if(e.length===0)return;const[r,s]=km(e);r.set(s+t,n),r.delete(s)},km=e=>e[e.length-1],Em="or",ik="and",Iz="and_not";class ea{constructor(t){if((t==null?void 0:t.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');const n=t.autoVacuum==null||t.autoVacuum===!0?sp:t.autoVacuum;this._options={...ap,...t,autoVacuum:n,searchOptions:{...u1,...t.searchOptions||{}},autoSuggestOptions:{...Hz,...t.autoSuggestOptions||{}}},this._index=new xi,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=Ug,this.addFields(this._options.fields)}add(t){const{extractField:n,tokenize:r,processTerm:s,fields:l,idField:o}=this._options,c=n(t,o);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${o}"`);if(this._idToShortId.has(c))throw new Error(`MiniSearch: duplicate ID ${c}`);const f=this.addDocumentId(c);this.saveStoredFields(f,t);for(const d of l){const p=n(t,d);if(p==null)continue;const g=r(p.toString(),d),m=this._fieldIds[d],b=new Set(g).size;this.addFieldLength(f,m,this._documentCount-1,b);for(const x of g){const w=s(x,d);if(Array.isArray(w))for(const _ of w)this.addTerm(m,f,_);else w&&this.addTerm(m,f,w)}}}addAll(t){for(const n of t)this.add(n)}addAllAsync(t,n={}){const{chunkSize:r=10}=n,s={chunk:[],promise:Promise.resolve()},{chunk:l,promise:o}=t.reduce(({chunk:c,promise:f},d,p)=>(c.push(d),(p+1)%r===0?{chunk:[],promise:f.then(()=>new Promise(g=>setTimeout(g,0))).then(()=>this.addAll(c))}:{chunk:c,promise:f}),s);return o.then(()=>this.addAll(l))}remove(t){const{tokenize:n,processTerm:r,extractField:s,fields:l,idField:o}=this._options,c=s(t,o);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${o}"`);const f=this._idToShortId.get(c);if(f==null)throw new Error(`MiniSearch: cannot remove document with ID ${c}: it is not in the index`);for(const d of l){const p=s(t,d);if(p==null)continue;const g=n(p.toString(),d),m=this._fieldIds[d],b=new Set(g).size;this.removeFieldLength(f,m,this._documentCount,b);for(const x of g){const w=r(x,d);if(Array.isArray(w))for(const _ of w)this.removeTerm(m,f,_);else w&&this.removeTerm(m,f,w)}}this._storedFields.delete(f),this._documentIds.delete(f),this._idToShortId.delete(c),this._fieldLength.delete(f),this._documentCount-=1}removeAll(t){if(t)for(const n of t)this.remove(n);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new xi,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(t){const n=this._idToShortId.get(t);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${t}: it is not in the index`);this._idToShortId.delete(t),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((r,s)=>{this.removeFieldLength(n,s,this._documentCount,r)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:t,minDirtCount:n,batchSize:r,batchWait:s}=this._options.autoVacuum;this.conditionalVacuum({batchSize:r,batchWait:s},{minDirtCount:n,minDirtFactor:t})}discardAll(t){const n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const r of t)this.discard(r)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(t){const{idField:n,extractField:r}=this._options,s=r(t,n);this.discard(s),this.add(t)}vacuum(t={}){return this.conditionalVacuum(t)}conditionalVacuum(t,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const r=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=Ug,this.performVacuuming(t,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)}async performVacuuming(t,n){const r=this._dirtCount;if(this.vacuumConditionsMet(n)){const s=t.batchSize||Pg.batchSize,l=t.batchWait||Pg.batchWait;let o=1;for(const[c,f]of this._index){for(const[d,p]of f)for(const[g]of p)this._documentIds.has(g)||(p.size<=1?f.delete(d):p.delete(g));this._index.get(c).size===0&&this._index.delete(c),o%s===0&&await new Promise(d=>setTimeout(d,l)),o+=1}this._dirtCount-=r}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(t){if(t==null)return!0;let{minDirtCount:n,minDirtFactor:r}=t;return n=n||sp.minDirtCount,r=r||sp.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=r}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(t){return this._idToShortId.has(t)}getStoredFields(t){const n=this._idToShortId.get(t);if(n!=null)return this._storedFields.get(n)}search(t,n={}){const{searchOptions:r}=this._options,s={...r,...n},l=this.executeQuery(t,n),o=[];for(const[c,{score:f,terms:d,match:p}]of l){const g=d.length||1,m={id:this._documentIds.get(c),score:f*g,terms:Object.keys(p),queryTerms:d,match:p};Object.assign(m,this._storedFields.get(c)),(s.filter==null||s.filter(m))&&o.push(m)}return t===ea.wildcard&&s.boostDocument==null||o.sort(f1),o}autoSuggest(t,n={}){n={...this._options.autoSuggestOptions,...n};const r=new Map;for(const{score:l,terms:o}of this.search(t,n)){const c=o.join(" "),f=r.get(c);f!=null?(f.score+=l,f.count+=1):r.set(c,{score:l,terms:o,count:1})}const s=[];for(const[l,{score:o,terms:c,count:f}]of r)s.push({suggestion:l,terms:c,score:o/f});return s.sort(f1),s}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),n)}static async loadJSONAsync(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(t),n)}static getDefault(t){if(ap.hasOwnProperty(t))return ip(ap,t);throw new Error(`MiniSearch: unknown option "${t}"`)}static loadJS(t,n){const{index:r,documentIds:s,fieldLength:l,storedFields:o,serializationVersion:c}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=qu(s),f._fieldLength=qu(l),f._storedFields=qu(o);for(const[d,p]of f._documentIds)f._idToShortId.set(p,d);for(const[d,p]of r){const g=new Map;for(const m of Object.keys(p)){let b=p[m];c===1&&(b=b.ds),g.set(parseInt(m,10),qu(b))}f._index.set(d,g)}return f}static async loadJSAsync(t,n){const{index:r,documentIds:s,fieldLength:l,storedFields:o,serializationVersion:c}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=await Gu(s),f._fieldLength=await Gu(l),f._storedFields=await Gu(o);for(const[p,g]of f._documentIds)f._idToShortId.set(g,p);let d=0;for(const[p,g]of r){const m=new Map;for(const b of Object.keys(g)){let x=g[b];c===1&&(x=x.ds),m.set(parseInt(b,10),await Gu(x))}++d%1e3===0&&await ak(0),f._index.set(p,m)}return f}static instantiateMiniSearch(t,n){const{documentCount:r,nextId:s,fieldIds:l,averageFieldLength:o,dirtCount:c,serializationVersion:f}=t;if(f!==1&&f!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const d=new ea(n);return d._documentCount=r,d._nextId=s,d._idToShortId=new Map,d._fieldIds=l,d._avgFieldLength=o,d._dirtCount=c||0,d._index=new xi,d}executeQuery(t,n={}){if(t===ea.wildcard)return this.executeWildcardQuery(n);if(typeof t!="string"){const m={...n,...t,queries:void 0},b=t.queries.map(x=>this.executeQuery(x,m));return this.combineResults(b,m.combineWith)}const{tokenize:r,processTerm:s,searchOptions:l}=this._options,o={tokenize:r,processTerm:s,...l,...n},{tokenize:c,processTerm:f}=o,g=c(t).flatMap(m=>f(m)).filter(m=>!!m).map(Uz(o)).map(m=>this.executeQuerySpec(m,o));return this.combineResults(g,o.combineWith)}executeQuerySpec(t,n){const r={...this._options.searchOptions,...n},s=(r.fields||this._options.fields).reduce((w,_)=>({...w,[_]:ip(r.boost,_)||1}),{}),{boostDocument:l,weights:o,maxFuzzy:c,bm25:f}=r,{fuzzy:d,prefix:p}={...u1.weights,...o},g=this._index.get(t.term),m=this.termResults(t.term,t.term,1,t.termBoost,g,s,l,f);let b,x;if(t.prefix&&(b=this._index.atPrefix(t.term)),t.fuzzy){const w=t.fuzzy===!0?.2:t.fuzzy,_=w<1?Math.min(c,Math.round(t.term.length*w)):w;_&&(x=this._index.fuzzyGet(t.term,_))}if(b)for(const[w,_]of b){const k=w.length-t.term.length;if(!k)continue;x==null||x.delete(w);const A=p*w.length/(w.length+.3*k);this.termResults(t.term,w,A,t.termBoost,_,s,l,f,m)}if(x)for(const w of x.keys()){const[_,k]=x.get(w);if(!k)continue;const A=d*w.length/(w.length+k);this.termResults(t.term,w,A,t.termBoost,_,s,l,f,m)}return m}executeWildcardQuery(t){const n=new Map,r={...this._options.searchOptions,...t};for(const[s,l]of this._documentIds){const o=r.boostDocument?r.boostDocument(l,"",this._storedFields.get(s)):1;n.set(s,{score:o,terms:[],match:{}})}return n}combineResults(t,n=Em){if(t.length===0)return new Map;const r=n.toLowerCase(),s=Bz[r];if(!s)throw new Error(`Invalid combination operator: ${n}`);return t.reduce(s)||new Map}toJSON(){const t=[];for(const[n,r]of this._index){const s={};for(const[l,o]of r)s[l]=Object.fromEntries(o);t.push([n,s])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:t,serializationVersion:2}}termResults(t,n,r,s,l,o,c,f,d=new Map){if(l==null)return d;for(const p of Object.keys(o)){const g=o[p],m=this._fieldIds[p],b=l.get(m);if(b==null)continue;let x=b.size;const w=this._avgFieldLength[m];for(const _ of b.keys()){if(!this._documentIds.has(_)){this.removeTerm(m,_,n),x-=1;continue}const k=c?c(this._documentIds.get(_),n,this._storedFields.get(_)):1;if(!k)continue;const A=b.get(_),S=this._fieldLength.get(_)[m],O=Pz(A,x,this._documentCount,S,w,f),D=r*s*g*k*O,M=d.get(_);if(M){M.score+=D,$z(M.terms,t);const F=ip(M.match,n);F?F.push(p):M.match[n]=[p]}else d.set(_,{score:D,terms:[t],match:{[n]:[p]}})}}return d}addTerm(t,n,r){const s=this._index.fetch(r,d1);let l=s.get(t);if(l==null)l=new Map,l.set(n,1),s.set(t,l);else{const o=l.get(n);l.set(n,(o||0)+1)}}removeTerm(t,n,r){if(!this._index.has(r)){this.warnDocumentChanged(n,t,r);return}const s=this._index.fetch(r,d1),l=s.get(t);l==null||l.get(n)==null?this.warnDocumentChanged(n,t,r):l.get(n)<=1?l.size<=1?s.delete(t):l.delete(n):l.set(n,l.get(n)-1),this._index.get(r).size===0&&this._index.delete(r)}warnDocumentChanged(t,n,r){for(const s of Object.keys(this._fieldIds))if(this._fieldIds[s]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(t)} has changed before removal: term "${r}" was not present in field "${s}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(t){const n=this._nextId;return this._idToShortId.set(t,n),this._documentIds.set(n,t),this._documentCount+=1,this._nextId+=1,n}addFields(t){for(let n=0;n<t.length;n++)this._fieldIds[t[n]]=n}addFieldLength(t,n,r,s){let l=this._fieldLength.get(t);l==null&&this._fieldLength.set(t,l=[]),l[n]=s;const c=(this._avgFieldLength[n]||0)*r+s;this._avgFieldLength[n]=c/(r+1)}removeFieldLength(t,n,r,s){if(r===1){this._avgFieldLength[n]=0;return}const l=this._avgFieldLength[n]*r-s;this._avgFieldLength[n]=l/(r-1)}saveStoredFields(t,n){const{storeFields:r,extractField:s}=this._options;if(r==null||r.length===0)return;let l=this._storedFields.get(t);l==null&&this._storedFields.set(t,l={});for(const o of r){const c=s(n,o);c!==void 0&&(l[o]=c)}}}ea.wildcard=Symbol("*");const ip=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,Bz={[Em]:(e,t)=>{for(const n of t.keys()){const r=e.get(n);if(r==null)e.set(n,t.get(n));else{const{score:s,terms:l,match:o}=t.get(n);r.score=r.score+s,r.match=Object.assign(r.match,o),c1(r.terms,l)}}return e},[ik]:(e,t)=>{const n=new Map;for(const r of t.keys()){const s=e.get(r);if(s==null)continue;const{score:l,terms:o,match:c}=t.get(r);c1(s.terms,o),n.set(r,{score:s.score+l,terms:s.terms,match:Object.assign(s.match,c)})}return n},[Iz]:(e,t)=>{for(const n of t.keys())e.delete(n);return e}},Fz={k:1.2,b:.7,d:.5},Pz=(e,t,n,r,s,l)=>{const{k:o,b:c,d:f}=l;return Math.log(1+(n-t+.5)/(t+.5))*(f+e*(o+1)/(e+o*(1-c+c*r/s)))},Uz=e=>(t,n,r)=>{const s=typeof e.fuzzy=="function"?e.fuzzy(t,n,r):e.fuzzy||!1,l=typeof e.prefix=="function"?e.prefix(t,n,r):e.prefix===!0,o=typeof e.boostTerm=="function"?e.boostTerm(t,n,r):1;return{term:t,fuzzy:s,prefix:l,termBoost:o}},ap={idField:"id",extractField:(e,t)=>e[t],tokenize:e=>e.split(Vz),processTerm:e=>e.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(e,t)=>{typeof(console==null?void 0:console[e])=="function"&&console[e](t)},autoVacuum:!0},u1={combineWith:Em,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Fz},Hz={combineWith:ik,prefix:(e,t,n)=>t===n.length-1},Pg={batchSize:1e3,batchWait:10},Ug={minDirtFactor:.1,minDirtCount:20},sp={...Pg,...Ug},$z=(e,t)=>{e.includes(t)||e.push(t)},c1=(e,t)=>{for(const n of t)e.includes(n)||e.push(n)},f1=({score:e},{score:t})=>t-e,d1=()=>new Map,qu=e=>{const t=new Map;for(const n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},Gu=async e=>{const t=new Map;let n=0;for(const r of Object.keys(e))t.set(parseInt(r,10),e[r]),++n%1e3===0&&await ak(0);return t},ak=e=>new Promise(t=>setTimeout(t,e)),Vz=/[\n\r\p{Z}\p{P}]+/u,h1={dbName:"minisearch_memory_db",dbVersion:1,storeName:"memory",miniSearchOptions:{fields:["text","path","tags","referencePath"],storeFields:["text","path","tags","referencePath"],tokenize:sk}};function sk(e){const t=e.replace(/ /g,""),n=new Intl.Segmenter("zh-CN",{granularity:"word"});return Array.from(n.segment(t)).map(s=>s.segment)}class qz extends Dz{constructor(n){const r={...h1,...n,miniSearchOptions:{...h1.miniSearchOptions,...(n==null?void 0:n.miniSearchOptions)||{}}};super(r);ut(this,"miniSearch");ut(this,"config");ut(this,"db");this.config=r}async initialize(){if(this.isInitialized)return;const{storeName:n}=this.config;this.db=await Tz(this.config.dbName,this.config.dbVersion,{upgrade(s){s.objectStoreNames.contains(n)||s.createObjectStore(n,{keyPath:"id",autoIncrement:!0}),s.objectStoreNames.contains("minisearch_index")||s.createObjectStore("minisearch_index")}});const r={fields:this.config.miniSearchOptions.fields||["text"],storeFields:this.config.miniSearchOptions.storeFields||["text"],tokenize:this.config.miniSearchOptions.tokenize||sk};this.miniSearch=new ea(r);try{const s=await this.loadMiniSearchIndex();if(s)console.log(s),this.miniSearch=await ea.loadJSAsync(s,r),console.log("MiniSearch index loaded from IndexedDB.");else{console.log("No saved index found, building from documents...");const l=await this.getAll();l.length>0?(this.miniSearch.addAll(l),await this.saveMiniSearchIndex(this.miniSearch.toJSON()),console.log(`MiniSearch index built from ${l.length} documents and saved.`)):console.log("No documents found, index is empty.")}this.isInitialized=!0}catch(s){throw console.error("Failed to initialize FullTextSearchService:",s),s}}async insert(n){const r=this.db.transaction(this.config.storeName,"readwrite"),s=r.objectStore(this.config.storeName),l={...n},o=await s.add(l);return l.id=Number(o),await r.done,this.miniSearch.add(l),await this.saveMiniSearchIndex(this.miniSearch.toJSON()),l.id}async update(n,r){const l=this.db.transaction(this.config.storeName,"readwrite").objectStore(this.config.storeName),o={...r,id:n};await l.put(o);const c=await l.get(n);c&&this.miniSearch.remove(c),this.miniSearch.add(o),await this.saveMiniSearchIndex(this.miniSearch.toJSON())}async delete(n){const s=this.db.transaction(this.config.storeName,"readwrite").objectStore(this.config.storeName),l=await s.get(n);l&&this.miniSearch.remove(l),await s.delete(n),await this.saveMiniSearchIndex(this.miniSearch.toJSON())}async query(n,r){return this.miniSearch.search(n,r).slice(0,(r==null?void 0:r.limit)??5).map(l=>{const{id:o,text:c,...f}=l;return{id:o,text:c,tags:f.tags,path:f.path,type:f.type,score:Math.round(l.score),referencePath:f.referencePath}})}async get(n){return this.db.transaction(this.config.storeName,"readonly").objectStore(this.config.storeName).get(n)}async getAll(){return this.db.transaction(this.config.storeName,"readonly").objectStore(this.config.storeName).getAll()}async loadMiniSearchIndex(){return this.db.transaction("minisearch_index","readonly").objectStore("minisearch_index").get("indexData")}async saveMiniSearchIndex(n){const r=this.db.transaction("minisearch_index","readwrite");await r.objectStore("minisearch_index").put(n,"indexData"),await r.done}}const lk=W.createContext({artifacts:[],currentArtifact:null,setCurrentArtifactById:()=>{},getArtifactVersions:()=>[],showArtifact:!1,setShowArtifact:()=>{}}),Gc=()=>W.useContext(lk),Gz=({children:e})=>{const[t,n]=W.useState([]),[r,s]=W.useState(!1),{renderMessages:l}=oa(),[o,c]=W.useState(null),f=p=>t.filter(g=>g.filename===p).sort((g,m)=>g.version-m.version);W.useEffect(()=>{if(!l)return;const p=l.filter(b=>b.type==="tool").filter(b=>b.name==="create_artifacts"),g=new Map,m=p.map(b=>{const x=JSON.parse(b.tool_input),w=x.filename,k=(g.get(w)||0)+1;return g.set(w,k),{id:b.id,code:x.code,filename:w,version:k,filetype:x.filetype}});n(m)},[l]);const d=p=>{s(!0),c(t.find(g=>g.id===p)||null)};return N.jsx(lk.Provider,{value:{artifacts:t,currentArtifact:o,setCurrentArtifactById:d,getArtifactVersions:f,showArtifact:r,setShowArtifact:s},children:e})},Zz=fs({name:"create_artifacts",description:"创建并保存代码文件到 artifacts 目录",parameters:[],onlyRender:!0,render(e){const t=e.getInputRepaired(),{setCurrentArtifactById:n,currentArtifact:r}=Gc(),s=()=>{n(e.message.id)};return N.jsxs("div",{className:"p-4 space-y-4",children:[N.jsxs("div",{className:"text-sm text-gray-500",children:["创建文件: ",t.filename,".",t.filetype]}),N.jsx("div",{className:"border rounded-lg p-2 hover:bg-gray-50",children:N.jsxs("div",{className:"flex items-center justify-between select-none cursor-pointer",onClick:s,children:[N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx(X3,{className:"w-4 h-4"}),N.jsx("span",{className:"font-xs",children:t.filename})]}),N.jsxs("span",{className:"text-gray-400",children:[t.filetype," ",(r==null?void 0:r.id)===e.message.id?"▼":"▶"]})]})})]})}}),Yz=localStorage.getItem("withCredentials")==="true"?(e,t)=>(t.credentials="include",fetch(e,t)):fetch,Xz=()=>({showHistory:localStorage.getItem("showHistory")==="true"||!1,showGraph:localStorage.getItem("showGraph")==="true"||!1}),p1=e=>{Object.entries(e).forEach(([t,n])=>{localStorage.setItem(t,n.toString())})},Am=new qz({dbName:"memory_fulltext_db",dbVersion:1,storeName:"memory"});Am.initialize();console.log(Am);const g1=xz(Am),Qz=UC(localStorage.getItem("agent_name")||"",{apiUrl:localStorage.getItem("apiUrl")||"http://localhost:8123",defaultHeaders:JSON.parse(localStorage.getItem("code")||"{}"),callerOptions:{fetch:Yz}},{...Xz(),onInit(e){e.tools.bindTools([Zz,yz,gz,mz,g1.manageMemory,g1.searchMemory])}});let lp=(e,t)=>n=>{e.current!==n&&(e.current=n,t())};function Kz(e,{keys:t,deps:n=[e,t]}={}){let r=W.useRef();r.current=e.get();let s=W.useCallback(o=>(lp(r,o)(e.value),(t==null?void 0:t.length)>0?LC(e,t,lp(r,o)):e.listen(lp(r,o))),n),l=()=>r.current;return W.useSyncExternalStore(s,l,l)}const ok=W.createContext(void 0),oa=()=>{const e=W.useContext(ok);if(!e)throw new Error("useChat must be used within a ChatProvider");return e},Jz=({children:e})=>{const t=oO(Qz,Kz);return W.useEffect(()=>{t.initClient().then(n=>{t.showHistory&&t.refreshHistoryList(),console.log(n)}).catch(n=>{console.error(n);const r=prompt("Failed to initialize chat client: "+t.currentAgent+`
|
|
209
|
+
请输入 agent 名称`);localStorage.setItem("agent_name",r),location.reload()})},[]),N.jsx(ok.Provider,{value:t,children:e})};function uk(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=uk(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ck(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=uk(e))&&(r&&(r+=" "),r+=t);return r}var Wz=Object.create,Zc=Object.defineProperty,e5=Object.defineProperties,t5=Object.getOwnPropertyDescriptor,n5=Object.getOwnPropertyDescriptors,fk=Object.getOwnPropertyNames,Sc=Object.getOwnPropertySymbols,r5=Object.getPrototypeOf,Tm=Object.prototype.hasOwnProperty,dk=Object.prototype.propertyIsEnumerable,m1=(e,t,n)=>t in e?Zc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sr=(e,t)=>{for(var n in t||(t={}))Tm.call(t,n)&&m1(e,n,t[n]);if(Sc)for(var n of Sc(t))dk.call(t,n)&&m1(e,n,t[n]);return e},Yc=(e,t)=>e5(e,n5(t)),hk=(e,t)=>{var n={};for(var r in e)Tm.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Sc)for(var r of Sc(e))t.indexOf(r)<0&&dk.call(e,r)&&(n[r]=e[r]);return n},i5=(e,t)=>function(){return t||(0,e[fk(e)[0]])((t={exports:{}}).exports,t),t.exports},a5=(e,t)=>{for(var n in t)Zc(e,n,{get:t[n],enumerable:!0})},s5=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of fk(t))!Tm.call(e,s)&&s!==n&&Zc(e,s,{get:()=>t[s],enumerable:!(r=t5(t,s))||r.enumerable});return e},l5=(e,t,n)=>(n=e!=null?Wz(r5(e)):{},s5(!e||!e.__esModule?Zc(n,"default",{value:e,enumerable:!0}):n,e)),o5=i5({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,t){var n=function(){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,s=0,l={},o={util:{encode:function x(w){return w instanceof c?new c(w.type,x(w.content),w.alias):Array.isArray(w)?w.map(x):w.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(x){return Object.prototype.toString.call(x).slice(8,-1)},objId:function(x){return x.__id||Object.defineProperty(x,"__id",{value:++s}),x.__id},clone:function x(w,_){_=_||{};var k,A;switch(o.util.type(w)){case"Object":if(A=o.util.objId(w),_[A])return _[A];k={},_[A]=k;for(var S in w)w.hasOwnProperty(S)&&(k[S]=x(w[S],_));return k;case"Array":return A=o.util.objId(w),_[A]?_[A]:(k=[],_[A]=k,w.forEach(function(O,D){k[D]=x(O,_)}),k);default:return w}},getLanguage:function(x){for(;x;){var w=r.exec(x.className);if(w)return w[1].toLowerCase();x=x.parentElement}return"none"},setLanguage:function(x,w){x.className=x.className.replace(RegExp(r,"gi"),""),x.classList.add("language-"+w)},isActive:function(x,w,_){for(var k="no-"+w;x;){var A=x.classList;if(A.contains(w))return!0;if(A.contains(k))return!1;x=x.parentElement}return!!_}},languages:{plain:l,plaintext:l,text:l,txt:l,extend:function(x,w){var _=o.util.clone(o.languages[x]);for(var k in w)_[k]=w[k];return _},insertBefore:function(x,w,_,k){k=k||o.languages;var A=k[x],S={};for(var O in A)if(A.hasOwnProperty(O)){if(O==w)for(var D in _)_.hasOwnProperty(D)&&(S[D]=_[D]);_.hasOwnProperty(O)||(S[O]=A[O])}var M=k[x];return k[x]=S,o.languages.DFS(o.languages,function(F,L){L===M&&F!=x&&(this[F]=S)}),S},DFS:function x(w,_,k,A){A=A||{};var S=o.util.objId;for(var O in w)if(w.hasOwnProperty(O)){_.call(w,O,w[O],k||O);var D=w[O],M=o.util.type(D);M==="Object"&&!A[S(D)]?(A[S(D)]=!0,x(D,_,null,A)):M==="Array"&&!A[S(D)]&&(A[S(D)]=!0,x(D,_,O,A))}}},plugins:{},highlight:function(x,w,_){var k={code:x,grammar:w,language:_};if(o.hooks.run("before-tokenize",k),!k.grammar)throw new Error('The language "'+k.language+'" has no grammar.');return k.tokens=o.tokenize(k.code,k.grammar),o.hooks.run("after-tokenize",k),c.stringify(o.util.encode(k.tokens),k.language)},tokenize:function(x,w){var _=w.rest;if(_){for(var k in _)w[k]=_[k];delete w.rest}var A=new p;return g(A,A.head,x),d(x,A,w,A.head,0),b(A)},hooks:{all:{},add:function(x,w){var _=o.hooks.all;_[x]=_[x]||[],_[x].push(w)},run:function(x,w){var _=o.hooks.all[x];if(!(!_||!_.length))for(var k=0,A;A=_[k++];)A(w)}},Token:c};function c(x,w,_,k){this.type=x,this.content=w,this.alias=_,this.length=(k||"").length|0}c.stringify=function x(w,_){if(typeof w=="string")return w;if(Array.isArray(w)){var k="";return w.forEach(function(M){k+=x(M,_)}),k}var A={type:w.type,content:x(w.content,_),tag:"span",classes:["token",w.type],attributes:{},language:_},S=w.alias;S&&(Array.isArray(S)?Array.prototype.push.apply(A.classes,S):A.classes.push(S)),o.hooks.run("wrap",A);var O="";for(var D in A.attributes)O+=" "+D+'="'+(A.attributes[D]||"").replace(/"/g,""")+'"';return"<"+A.tag+' class="'+A.classes.join(" ")+'"'+O+">"+A.content+"</"+A.tag+">"};function f(x,w,_,k){x.lastIndex=w;var A=x.exec(_);if(A&&k&&A[1]){var S=A[1].length;A.index+=S,A[0]=A[0].slice(S)}return A}function d(x,w,_,k,A,S){for(var O in _)if(!(!_.hasOwnProperty(O)||!_[O])){var D=_[O];D=Array.isArray(D)?D:[D];for(var M=0;M<D.length;++M){if(S&&S.cause==O+","+M)return;var F=D[M],L=F.inside,U=!!F.lookbehind,j=!!F.greedy,H=F.alias;if(j&&!F.pattern.global){var B=F.pattern.toString().match(/[imsuy]*$/)[0];F.pattern=RegExp(F.pattern.source,B+"g")}for(var q=F.pattern||F,R=k.next,$=A;R!==w.tail&&!(S&&$>=S.reach);$+=R.value.length,R=R.next){var I=R.value;if(w.length>x.length)return;if(!(I instanceof c)){var P=1,Y;if(j){if(Y=f(q,$,x,U),!Y||Y.index>=x.length)break;var te=Y.index,X=Y.index+Y[0].length,E=$;for(E+=R.value.length;te>=E;)R=R.next,E+=R.value.length;if(E-=R.value.length,$=E,R.value instanceof c)continue;for(var G=R;G!==w.tail&&(E<X||typeof G.value=="string");G=G.next)P++,E+=G.value.length;P--,I=x.slice($,E),Y.index-=$}else if(Y=f(q,0,I,U),!Y)continue;var te=Y.index,T=Y[0],V=I.slice(0,te),K=I.slice(te+T.length),J=$+I.length;S&&J>S.reach&&(S.reach=J);var le=R.prev;V&&(le=g(w,le,V),$+=V.length),m(w,le,P);var fe=new c(O,L?o.tokenize(T,L):T,H,T);if(R=g(w,le,fe),K&&g(w,R,K),P>1){var ye={cause:O+","+M,reach:J};d(x,w,_,R.prev,$,ye),S&&ye.reach>S.reach&&(S.reach=ye.reach)}}}}}}function p(){var x={value:null,prev:null,next:null},w={value:null,prev:x,next:null};x.next=w,this.head=x,this.tail=w,this.length=0}function g(x,w,_){var k=w.next,A={value:_,prev:w,next:k};return w.next=A,k.prev=A,x.length++,A}function m(x,w,_){for(var k=w.next,A=0;A<_&&k!==x.tail;A++)k=k.next;w.next=k,k.prev=w,x.length-=A}function b(x){for(var w=[],_=x.head.next;_!==x.tail;)w.push(_.value),_=_.next;return w}return o}();t.exports=n,n.default=n}}),ce=l5(o5());ce.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},ce.languages.markup.tag.inside["attr-value"].inside.entity=ce.languages.markup.entity,ce.languages.markup.doctype.inside["internal-subset"].inside=ce.languages.markup,ce.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(ce.languages.markup.tag,"addInlined",{value:function(e,r){var n={},n=(n["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:ce.languages[r]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),r=(n["language-"+r]={pattern:/[\s\S]+/,inside:ce.languages[r]},{});r[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:n},ce.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(ce.languages.markup.tag,"addAttribute",{value:function(e,t){ce.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:ce.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),ce.languages.html=ce.languages.markup,ce.languages.mathml=ce.languages.markup,ce.languages.svg=ce.languages.markup,ce.languages.xml=ce.languages.extend("markup",{}),ce.languages.ssml=ce.languages.xml,ce.languages.atom=ce.languages.xml,ce.languages.rss=ce.languages.xml,function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+n.source+")",r=RegExp(r+"-"+r),s={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":t,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":s}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":s}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}}(ce),ce.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},ce.languages.javascript=ce.languages.extend("clike",{"class-name":[ce.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),ce.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,ce.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:ce.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:ce.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:ce.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:ce.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:ce.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),ce.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:ce.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),ce.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),ce.languages.markup&&(ce.languages.markup.tag.addInlined("script","javascript"),ce.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),ce.languages.js=ce.languages.javascript,ce.languages.actionscript=ce.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),ce.languages.actionscript["class-name"].alias="function",delete ce.languages.actionscript.parameter,delete ce.languages.actionscript["literal-property"],ce.languages.markup&&ce.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:ce.languages.markup}}),function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(ce),function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(t,"addSupport",{value:function(n,r){(n=typeof n=="string"?[n]:n).forEach(function(s){var l=function(g){g.inside||(g.inside={}),g.inside.rest=r},o="doc-comment";if(c=e.languages[s]){var c,f=c[o];if((f=f||(c=e.languages.insertBefore(s,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[o])instanceof RegExp&&(f=c[o]={pattern:f}),Array.isArray(f))for(var d=0,p=f.length;d<p;d++)f[d]instanceof RegExp&&(f[d]={pattern:f[d]}),l(f[d]);else l(f)}})}}),t.addSupport(["java","javascript","php"],t)}(ce),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,t=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))}(ce),function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,t=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+t.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[t,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,number:n})}(ce),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+n.source+")?)",s=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),l=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(c,f){f=(f||"").replace(/m/g,"")+"m";var d=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return c});return RegExp(d,f)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+s+"|"+l+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(l),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(ce),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(d){return d=d.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+d+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,s=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),l=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,o=(e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+s+l+"(?:"+s+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+s+l+")(?:"+s+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+s+")"+l+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+s+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(d){["url","bold","italic","strike","code-snippet"].forEach(function(p){d!==p&&(e.languages.markdown[d].inside.content.inside[p]=e.languages.markdown[p])})}),e.hooks.add("after-tokenize",function(d){d.language!=="markdown"&&d.language!=="md"||function p(g){if(g&&typeof g!="string")for(var m=0,b=g.length;m<b;m++){var x,w=g[m];w.type!=="code"?p(w.content):(x=w.content[1],w=w.content[3],x&&w&&x.type==="code-language"&&w.type==="code-block"&&typeof x.content=="string"&&(x=x.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),x="language-"+(x=(/[a-z][\w-]*/i.exec(x)||[""])[0].toLowerCase()),w.alias?typeof w.alias=="string"?w.alias=[w.alias,x]:w.alias.push(x):w.alias=[x]))}}(d.tokens)}),e.hooks.add("wrap",function(d){if(d.type==="code-block"){for(var p="",g=0,m=d.classes.length;g<m;g++){var b=d.classes[g],b=/language-(.+)/.exec(b);if(b){p=b[1];break}}var x,w=e.languages[p];w?d.content=e.highlight(function(_){return _=_.replace(o,""),_=_.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(k,A){var S;return(A=A.toLowerCase())[0]==="#"?(S=A[1]==="x"?parseInt(A.slice(2),16):Number(A.slice(1)),f(S)):c[A]||k})}(d.content),w,p):p&&p!=="none"&&e.plugins.autoloader&&(x="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),d.attributes.id=x,e.plugins.autoloader.loadLanguages(p,function(){var _=document.getElementById(x);_&&(_.innerHTML=e.highlight(_.textContent,e.languages[p],p))}))}}),RegExp(e.languages.markup.tag.pattern.source,"gi")),c={amp:"&",lt:"<",gt:">",quot:'"'},f=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(ce),ce.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:ce.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},ce.hooks.add("after-tokenize",function(e){if(e.language==="graphql")for(var t=e.tokens.filter(function(x){return typeof x!="string"&&x.type!=="comment"&&x.type!=="scalar"}),n=0;n<t.length;){var r=t[n++];if(r.type==="keyword"&&r.content==="mutation"){var s=[];if(g(["definition-mutation","punctuation"])&&p(1).content==="("){n+=2;var l=m(/^\($/,/^\)$/);if(l===-1)continue;for(;n<l;n++){var o=p(0);o.type==="variable"&&(b(o,"variable-input"),s.push(o.content))}n=l+1}if(g(["punctuation","property-query"])&&p(0).content==="{"&&(n++,b(p(0),"property-mutation"),0<s.length)){var c=m(/^\{$/,/^\}$/);if(c!==-1)for(var f=n;f<c;f++){var d=t[f];d.type==="variable"&&0<=s.indexOf(d.content)&&b(d,"variable-input")}}}}function p(x){return t[n+x]}function g(x,w){w=w||0;for(var _=0;_<x.length;_++){var k=p(_+w);if(!k||k.type!==x[_])return}return 1}function m(x,w){for(var _=1,k=n;k<t.length;k++){var A=t[k],S=A.content;if(A.type==="punctuation"&&typeof S=="string"){if(x.test(S))_++;else if(w.test(S)&&--_===0)return k}}return-1}function b(x,w){var _=x.alias;_?Array.isArray(_)||(x.alias=_=[_]):x.alias=_=[],_.push(w)}}),ce.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,s=r.inside["interpolation-punctuation"],l=r.pattern.source;function o(g,m){if(e.languages[g])return{pattern:RegExp("((?:"+m+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:g}}}}function c(g,m,b){return g={code:g,grammar:m,language:b},e.hooks.run("before-tokenize",g),g.tokens=e.tokenize(g.code,g.grammar),e.hooks.run("after-tokenize",g),g.tokens}function f(g,m,b){var _=e.tokenize(g,{interpolation:{pattern:RegExp(l),lookbehind:!0}}),x=0,w={},_=c(_.map(function(A){if(typeof A=="string")return A;for(var S,O,A=A.content;g.indexOf((O=x++,S="___"+b.toUpperCase()+"_"+O+"___"))!==-1;);return w[S]=A,S}).join(""),m,b),k=Object.keys(w);return x=0,function A(S){for(var O=0;O<S.length;O++){if(x>=k.length)return;var D,M,F,L,U,j,H,B=S[O];typeof B=="string"||typeof B.content=="string"?(D=k[x],(H=(j=typeof B=="string"?B:B.content).indexOf(D))!==-1&&(++x,M=j.substring(0,H),U=w[D],F=void 0,(L={})["interpolation-punctuation"]=s,(L=e.tokenize(U,L)).length===3&&((F=[1,1]).push.apply(F,c(L[1],e.languages.javascript,"javascript")),L.splice.apply(L,F)),F=new e.Token("interpolation",L,r.alias,U),L=j.substring(H+D.length),U=[],M&&U.push(M),U.push(F),L&&(A(j=[L]),U.push.apply(U,j)),typeof B=="string"?(S.splice.apply(S,[O,1].concat(U)),O+=U.length-1):B.content=U)):(H=B.content,Array.isArray(H)?A(H):A([H]))}}(_),new e.Token(b,_,"language-"+b,g)}e.languages.javascript["template-string"]=[o("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),o("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),o("svg",/\bsvg/.source),o("markdown",/\b(?:markdown|md)/.source),o("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),o("sql",/\bsql/.source),t].filter(Boolean);var d={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function p(g){return typeof g=="string"?g:Array.isArray(g)?g.map(p).join(""):p(g.content)}e.hooks.add("after-tokenize",function(g){g.language in d&&function m(b){for(var x=0,w=b.length;x<w;x++){var _,k,A,S=b[x];typeof S!="string"&&(_=S.content,Array.isArray(_)?S.type==="template-string"?(S=_[1],_.length===3&&typeof S!="string"&&S.type==="embedded-code"&&(k=p(S),S=S.alias,S=Array.isArray(S)?S[0]:S,A=e.languages[S])&&(_[1]=f(k,A,S))):m(_):typeof _!="string"&&m([_]))}}(g.tokens)})}(ce),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(ce),function(e){var t=e.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:t.string,number:t.number,boolean:t.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:t,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)}(ce),function(e){e.languages.flow=e.languages.extend("javascript",{}),e.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),e.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(ce),ce.languages.n4js=ce.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),ce.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),ce.languages.n4jsd=ce.languages.n4js,function(e){function t(o,c){return RegExp(o.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),c)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var l=n[r],s=e.languages.javascript[l],l=(s=e.util.type(s)==="RegExp"?e.languages.javascript[l]={pattern:s}:s).inside||{};(s.inside=l)["maybe-class-name"]=/^[A-Z][\s\S]*/}}(ce),function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,s=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function l(f,d){return f=f.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return s}),RegExp(f,d)}s=l(s).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=l(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:l(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:l(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);function o(f){for(var d=[],p=0;p<f.length;p++){var g=f[p],m=!1;typeof g!="string"&&(g.type==="tag"&&g.content[0]&&g.content[0].type==="tag"?g.content[0].content[0].content==="</"?0<d.length&&d[d.length-1].tagName===c(g.content[0].content[1])&&d.pop():g.content[g.content.length-1].content!=="/>"&&d.push({tagName:c(g.content[0].content[1]),openedBraces:0}):0<d.length&&g.type==="punctuation"&&g.content==="{"?d[d.length-1].openedBraces++:0<d.length&&0<d[d.length-1].openedBraces&&g.type==="punctuation"&&g.content==="}"?d[d.length-1].openedBraces--:m=!0),(m||typeof g=="string")&&0<d.length&&d[d.length-1].openedBraces===0&&(m=c(g),p<f.length-1&&(typeof f[p+1]=="string"||f[p+1].type==="plain-text")&&(m+=c(f[p+1]),f.splice(p+1,1)),0<p&&(typeof f[p-1]=="string"||f[p-1].type==="plain-text")&&(m=c(f[p-1])+m,f.splice(p-1,1),p--),f[p]=new e.Token("plain-text",m,null,m)),g.content&&typeof g.content!="string"&&o(g.content)}}var c=function(f){return f?typeof f=="string"?f:typeof f.content=="string"?f.content:f.content.map(c).join(""):""};e.hooks.add("after-tokenize",function(f){f.language!=="jsx"&&f.language!=="tsx"||o(f.tokens)})}(ce),function(e){var t=e.util.clone(e.languages.typescript),t=(e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"],e.languages.tsx.tag);t.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+t.pattern.source+")",t.pattern.flags),t.lookbehind=!0}(ce),ce.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},ce.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=ce.languages.swift}),function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(ce),ce.languages.c=ce.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),ce.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),ce.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},ce.languages.c.string],char:ce.languages.c.char,comment:ce.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:ce.languages.c}}}}),ce.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete ce.languages.c.boolean,ce.languages.objectivec=ce.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete ce.languages.objectivec["class-name"],ce.languages.objc=ce.languages.objectivec,ce.languages.reason=ce.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),ce.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete ce.languages.reason.function,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(ce),ce.languages.go=ce.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),ce.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete ce.languages.go["class-name"],function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(ce),ce.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},ce.languages.python["string-interpolation"].inside.interpolation.inside.rest=ce.languages.python,ce.languages.py=ce.languages.python,ce.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},ce.languages.webmanifest=ce.languages.json;var pk={};a5(pk,{dracula:()=>c5,duotoneDark:()=>d5,duotoneLight:()=>p5,github:()=>m5,gruvboxMaterialDark:()=>q5,gruvboxMaterialLight:()=>Z5,jettwaveDark:()=>I5,jettwaveLight:()=>F5,nightOwl:()=>b5,nightOwlLight:()=>x5,oceanicNext:()=>_5,okaidia:()=>k5,oneDark:()=>U5,oneLight:()=>$5,palenight:()=>A5,shadesOfPurple:()=>N5,synthwave84:()=>O5,ultramin:()=>R5,vsDark:()=>gk,vsLight:()=>z5});var u5={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},c5=u5,f5={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},d5=f5,h5={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},p5=h5,g5={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},m5=g5,y5={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},b5=y5,v5={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},x5=v5,yn={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},w5={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:yn.keyword}},{types:["attr-value"],style:{color:yn.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:yn.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:yn.primitive}},{types:["boolean"],style:{color:yn.boolean}},{types:["tag"],style:{color:yn.tag}},{types:["string"],style:{color:yn.string}},{types:["punctuation"],style:{color:yn.string}},{types:["selector","char","builtin","inserted"],style:{color:yn.char}},{types:["function"],style:{color:yn.function}},{types:["operator","entity","url","variable"],style:{color:yn.variable}},{types:["keyword"],style:{color:yn.keyword}},{types:["atrule","class-name"],style:{color:yn.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},_5=w5,S5={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},k5=S5,E5={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},A5=E5,T5={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},N5=T5,C5={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},O5=C5,M5={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},R5=M5,D5={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},gk=D5,j5={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},z5=j5,L5={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},I5=L5,B5={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},F5=B5,P5={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},U5=P5,H5={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},$5=H5,V5={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},q5=V5,G5={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},Z5=G5,Y5=e=>W.useCallback(t=>{var n=t,{className:r,style:s,line:l}=n,o=hk(n,["className","style","line"]);const c=Yc(sr({},o),{className:ck("token-line",r)});return typeof e=="object"&&"plain"in e&&(c.style=e.plain),typeof s=="object"&&(c.style=sr(sr({},c.style||{}),s)),c},[e]),X5=e=>{const t=W.useCallback(({types:n,empty:r})=>{if(e!=null){{if(n.length===1&&n[0]==="plain")return r!=null?{display:"inline-block"}:void 0;if(n.length===1&&r!=null)return e[n[0]]}return Object.assign(r!=null?{display:"inline-block"}:{},...n.map(s=>e[s]))}},[e]);return W.useCallback(n=>{var r=n,{token:s,className:l,style:o}=r,c=hk(r,["token","className","style"]);const f=Yc(sr({},c),{className:ck("token",...s.types,l),children:s.content,style:t(s)});return o!=null&&(f.style=sr(sr({},f.style||{}),o)),f},[t])},Q5=/\r\n|\r|\n/,y1=e=>{e.length===0?e.push({types:["plain"],content:`
|
|
210
210
|
`,empty:!0}):e.length===1&&e[0].content===""&&(e[0].content=`
|
|
211
|
-
`,e[0].empty=!0)},
|
|
211
|
+
`,e[0].empty=!0)},b1=(e,t)=>{const n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},K5=e=>{const t=[[]],n=[e],r=[0],s=[e.length];let l=0,o=0,c=[];const f=[c];for(;o>-1;){for(;(l=r[o]++)<s[o];){let d,p=t[o];const m=n[o][l];if(typeof m=="string"?(p=o>0?p:["plain"],d=m):(p=b1(p,m.type),m.alias&&(p=b1(p,m.alias)),d=m.content),typeof d!="string"){o++,t.push(p),n.push(d),r.push(0),s.push(d.length);continue}const b=d.split(Q5),x=b.length;c.push({types:p,content:b[0]});for(let w=1;w<x;w++)y1(c),f.push(c=[]),c.push({types:p,content:b[w]})}o--,t.pop(),n.pop(),r.pop(),s.pop()}return y1(c),f},v1=K5,J5=({prism:e,code:t,grammar:n,language:r})=>W.useMemo(()=>{if(n==null)return v1([t]);const s={code:t,grammar:n,language:r,tokens:[]};return e.hooks.run("before-tokenize",s),s.tokens=e.tokenize(t,n),e.hooks.run("after-tokenize",s),v1(s.tokens)},[t,n,r,e]),W5=(e,t)=>{const{plain:n}=e,r=e.styles.reduce((s,l)=>{const{languages:o,style:c}=l;return o&&!o.includes(t)||l.types.forEach(f=>{const d=sr(sr({},s[f]),c);s[f]=d}),s},{});return r.root=n,r.plain=Yc(sr({},n),{backgroundColor:void 0}),r},eL=W5,tL=({children:e,language:t,code:n,theme:r,prism:s})=>{const l=t.toLowerCase(),o=eL(r,l),c=Y5(o),f=X5(o),d=s.languages[l],p=J5({prism:s,language:l,code:n,grammar:d});return e({tokens:p,className:`prism-code language-${l}`,style:o!=null?o.root:{},getLineProps:c,getTokenProps:f})},nL=e=>W.createElement(tL,Yc(sr({},e),{prism:e.prism||ce,theme:e.theme||gk,code:e.code,language:e.language}));/*! Bundled license information:
|
|
212
212
|
|
|
213
213
|
prismjs/prism.js:
|
|
214
214
|
(**
|
|
@@ -219,7 +219,7 @@ prismjs/prism.js:
|
|
|
219
219
|
* @namespace
|
|
220
220
|
* @public
|
|
221
221
|
*)
|
|
222
|
-
*/const v1=["border-red-400","border-blue-400","border-green-500","border-yellow-400","border-purple-400","border-pink-400","border-indigo-400"],rL=e=>{let t=0;for(let r=0;r<e.length;r++)t=e.charCodeAt(r)+((t<<5)-t);const n=Math.abs(t%v1.length);return v1[n]},iL=({message:e,client:t,getMessageContent:n,formatTokens:r,isCollapsed:s,onToggleCollapse:l})=>{const{getToolUIRender:o}=oa(),c=o(e.name),f=rL(e.name);return C.jsx("div",{className:"flex flex-col w-full",children:c?c(e):C.jsxs("div",{className:`flex flex-col w-full bg-white rounded-lg shadow-sm border-2 ${f} overflow-hidden`,children:[C.jsx("div",{className:"flex items-center justify-between p-3 cursor-pointer hover:bg-gray-100 transition-colors",onClick:l,children:C.jsxs("div",{className:"text-sm font-medium text-gray-700",onClick:()=>console.log(e),children:[e.node_name," | ",e.name]})}),!s&&C.jsxs("div",{className:"flex flex-col gap-4 p-4 border-t border-gray-100",children:[C.jsx(x1,{content:e.tool_input||""}),C.jsx(x1,{content:n(e.content)}),C.jsx(rm,{response_metadata:e.response_metadata,usage_metadata:e.usage_metadata||{},spend_time:e.spend_time,id:e.id,tool_call_id:e.tool_call_id})]})]})})},x1=({content:e})=>{const t=()=>{try{return JSON.parse(e),!0}catch{return!1}},n=e.startsWith("{")&&e.endsWith("}")&&t(),r=e.includes("#")||e.includes("```")||e.includes("*"),[s,l]=W.useState(n),[o,c]=W.useState(!1),f=()=>{navigator.clipboard.writeText(e)};return C.jsxs("div",{className:"flex flex-col",children:[C.jsxs("div",{className:"flex gap-2 mb-2",children:[C.jsx("button",{onClick:f,className:"px-2 py-1 text-xs font-medium text-gray-600 bg-green-100 rounded hover:bg-green-200 transition-colors",children:"copy"}),n&&C.jsx("button",{onClick:()=>l(!s),className:"px-2 py-1 text-xs font-medium text-gray-600 bg-orange-100 rounded hover:bg-orange-200 transition-colors",children:"json"}),r&&C.jsx("button",{onClick:()=>c(!o),className:"px-2 py-1 text-xs font-medium text-gray-600 bg-blue-100 rounded hover:bg-blue-200 transition-colors",children:"markdown"})]}),C.jsx("div",{className:"flex flex-col max-h-[300px] overflow-auto border border-gray-200 rounded p-2 w-full text-xs font-mono whitespace-pre-wrap",children:s&&n?C.jsx(nL,{code:JSON.stringify(JSON.parse(e),null,2),language:"json",theme:hk.oneLight,children:({className:d,style:p,tokens:g,getLineProps:m,getTokenProps:b})=>C.jsx("pre",{style:p,children:g.map((x,w)=>C.jsx("div",{...m({line:x}),children:x.map((_,k)=>C.jsx("span",{...b({token:_})},k))},w))})}):o&&r?C.jsx("div",{className:"markdown-body",children:C.jsx(_S,{remarkPlugins:[GS],children:e})}):C.jsx("pre",{className:"whitespace-pre-wrap",children:e})})]})},gk=({renderMessages:e,collapsedTools:t,toggleToolCollapse:n,client:r})=>C.jsx("div",{className:"flex flex-col gap-4 w-full",children:e.map((s,l)=>C.jsx("div",{children:s.type==="human"?C.jsx(jT,{content:s.content}):s.type==="tool"?C.jsx(iL,{message:s,client:r,getMessageContent:am,formatTokens:FN,isCollapsed:t.includes(s.id),onToggleCollapse:()=>n(s.id)}):C.jsx(M3,{message:s})},s.unique_id))}),aL=({onClose:e,formatTime:t})=>{const{historyList:n,currentChatId:r,refreshHistoryList:s,createNewChat:l,deleteHistoryChat:o,toHistoryChat:c}=oa();return C.jsxs("div",{className:" bg-white rounded-lg shadow-md h-full flex flex-col border-r",children:[C.jsxs("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center h-16",children:[C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsx("h3",{className:"m-0 text-lg text-gray-800",children:"历史记录"}),C.jsx("button",{className:"p-1.5 text-base rounded bg-blue-100 hover:bg-blue-200 transition-all duration-200 flex items-center justify-center hover:scale-110 group",onClick:s,title:"刷新列表",children:C.jsx(lz,{className:"w-4 h-4 text-blue-600 group-hover:text-blue-700 group-hover:rotate-180 transition-all duration-300"})})]}),C.jsx("button",{className:"p-1.5 text-base rounded bg-red-100 hover:bg-red-200 transition-all duration-200 flex items-center justify-center hover:scale-110 group",onClick:e,title:"关闭",children:C.jsx(XS,{className:"w-4 h-4 text-red-600 group-hover:text-red-700"})})]}),C.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[C.jsx("div",{className:"flex flex-col gap-3 cursor-pointer",onClick:()=>{l()},children:C.jsx("div",{className:"flex justify-between items-center p-3 rounded-lg bg-gray-50 hover:bg-gray-100 transition-colors duration-200",children:C.jsx("div",{className:"text-sm text-gray-800 truncate",children:"New Chat"})})}),n.length===0?C.jsx("div",{className:"text-center text-gray-500 py-8",children:"暂无历史记录"}):C.jsx("div",{className:"flex flex-col gap-3 mt-3",children:n.sort((f,d)=>new Date(d.created_at).getTime()-new Date(f.created_at).getTime()).map(f=>C.jsxs("div",{className:`flex justify-between items-center p-3 rounded-lg transition-colors duration-200 ${f.thread_id===r?"bg-blue-50 border border-blue-200":"bg-gray-50 hover:bg-gray-100"}`,children:[C.jsxs("div",{className:"flex-1 min-w-0 mr-2",children:[C.jsx("div",{className:"text-sm text-gray-800 mb-1 truncate max-w-[180px]",children:PN(f)}),C.jsxs("div",{className:"flex gap-3 text-xs text-gray-500",children:[C.jsx("span",{className:"truncate max-w-[100px]",children:t(new Date(f.created_at))}),C.jsx("span",{className:"truncate max-w-[60px]",children:f.status})]})]}),C.jsxs("div",{className:"flex gap-2 shrink-0",children:[C.jsx("button",{className:"p-1.5 text-base rounded bg-green-100 hover:bg-green-200 transition-all duration-200 flex items-center justify-center hover:scale-110 group",onClick:()=>{c(f)},title:"恢复对话",children:C.jsx(uz,{className:"w-4 h-4 text-green-600 group-hover:text-green-700 group-hover:-rotate-180 transition-all duration-300"})}),C.jsx("button",{className:"p-1.5 text-base rounded bg-red-100 hover:bg-red-200 transition-all duration-200 flex items-center justify-center hover:scale-110 group",onClick:async()=>{await o(f)},title:"删除对话",children:C.jsx(hz,{className:"w-4 h-4 text-red-600 group-hover:text-red-700"})})]})]},f.thread_id))})]})]})},mk=W.createContext(void 0),sL=({children:e})=>{const[t,n]=W.useState(()=>{const s=localStorage.getItem("extraParams");try{return s?JSON.parse(s):{}}catch(l){return console.error("Failed to parse extraParams from localStorage",l),{}}});W.useEffect(()=>{localStorage.setItem("extraParams",JSON.stringify(t))},[t]);const r=s=>{n(s)};return C.jsx(mk.Provider,{value:{extraParams:t,setExtraParams:r},children:e})},yk=()=>{const e=W.useContext(mk);if(e===void 0)throw new Error("useExtraParams must be used within an ExtraParamsProvider");return e};class lL{constructor(t={}){ut(this,"apiUrl");this.apiUrl=t.apiUrl||""}createFormData(t,n){const r=new FormData;if(typeof t=="string"){const s=new Blob([t],{type:"text/plain"});r.append("file",s,n||"file.txt")}else r.append("file",t,n||(t instanceof File?t.name:"file"));return r}async upload(t,n={}){const s={method:"POST",body:this.createFormData(t,n.filename)};n.signal&&(s.signal=n.signal);try{const l=await fetch(`${this.apiUrl}${this.getUploadEndpoint()}`,s);if(!l.ok)throw new Error(`Upload failed with status: ${l.status}`);const o=await l.json();return this.processResponse(o)}catch(l){throw new Error(`File upload failed: ${l instanceof Error?l.message:String(l)}`)}}}class oL extends lL{constructor(t={}){super({apiUrl:t.apiUrl||"https://tmpfiles.org/api/v1"})}getUploadEndpoint(){return"/upload"}processResponse(t){var n;return(n=t.data)!=null&&n.url&&(t.data.url=t.data.url.replace("//tmpfiles.org/","//tmpfiles.org/dl/")),t}}const uL=({onFileUploaded:e})=>{const[t,n]=W.useState([]),r=new oL,s=3,l=W.useCallback(async c=>{var p;const d=Array.from(c.target.files||[]).filter(g=>g.type.startsWith("image/"));if(t.length+d.length>s){alert(`最多只能上传${s}张图片`),c.target.value="";return}n(g=>[...g,...d]);for(const g of d)try{const m=await r.upload(g);(p=m.data)!=null&&p.url&&e(m.data.url)}catch(m){console.error("Upload failed:",m)}c.target.value=""},[e,t.length]),o=W.useCallback(c=>{n(f=>f.filter((d,p)=>p!==c))},[]);return C.jsxs("div",{className:"flex gap-2 rounded-lg flex-1",children:[t.length<s&&C.jsxs("label",{className:`inline-flex items-center justify-center w-20 h-20 text-gray-500 bg-gray-100 rounded-lg cursor-pointer transition-all duration-200 hover:bg-gray-200 ${t.length===0?"w-8 h-8":""}`,children:[C.jsxs("svg",{viewBox:"0 0 24 24",width:t.length===0?"20":"32",height:t.length===0?"20":"32",fill:"currentColor",children:[C.jsx("path",{d:"M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z"}),C.jsx("path",{d:"M20 4h-3.17l-1.24-1.35A1.99 1.99 0 0 0 14.12 2H9.88c-.56 0-1.1.24-1.48.65L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 13c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"})]}),C.jsx("input",{type:"file",accept:"image/*",multiple:!0,onChange:l,className:"hidden"})]}),C.jsx("div",{className:"flex flex-wrap gap-2",children:t.map((c,f)=>C.jsxs("div",{className:"relative w-20 h-20 rounded-lg overflow-hidden",children:[C.jsx("img",{src:URL.createObjectURL(c),alt:c.name,className:"w-full h-full object-cover border border-gray-200"}),C.jsx("button",{className:"absolute top-0.5 right-0.5 w-5 h-5 bg-black/50 text-white rounded-full flex items-center justify-center text-base leading-none hover:bg-black/70 transition-colors",onClick:()=>o(f),children:"×"})]},f))})]})},w1="json-editor-presets",_1="json-editor-active-tab",cL=({isOpen:e,initialJson:t,onClose:n,onSave:r})=>{const[s,l]=W.useState([]),[o,c]=W.useState(0),[f,d]=W.useState(""),[p,g]=W.useState(null),[m,b]=W.useState(null),[x,w]=W.useState("");if(W.useEffect(()=>{if(e){let D=[];try{const F=localStorage.getItem(w1);D=F?JSON.parse(F):[]}catch(F){console.error("Failed to parse presets from localStorage",F),D=[]}D.length===0&&(D=[{name:"Default",data:t}]),l(D);let M=0;try{const F=localStorage.getItem(_1);if(F){const L=parseInt(F,10);L>=0&&L<D.length&&(M=L)}}catch(F){console.error("Failed to parse active tab from localStorage",F)}c(M),g(null)}},[e,t]),W.useEffect(()=>{e&&s.length>0&&s[o]&&(d(JSON.stringify(s[o].data,null,2)),g(null))},[o,s,e]),W.useEffect(()=>{e&&localStorage.setItem(_1,o.toString())},[o,e]),!e)return null;const _=D=>{l(D),localStorage.setItem(w1,JSON.stringify(D))},k=()=>{const D={name:`Preset ${s.length+1}`,data:{}},M=[...s,D];_(M),c(M.length-1)},A=D=>{let M=s.filter((F,L)=>L!==D);M.length===0&&(M=[{name:"Default",data:t}]),_(M),o>=D&&o>0?c(o-1):o>=M.length&&c(M.length-1)},S=()=>{try{const D=JSON.parse(f),M=s.map((F,L)=>L===o?{...F,data:D}:F);_(M),r(D),n()}catch(D){g("JSON 格式无效,请检查后重试。"),console.error("Invalid JSON format:",D)}},O=D=>{if(x.trim()!==""){const M=s.map((F,L)=>L===D?{...F,name:x.trim()}:F);_(M),b(null)}};return C.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:C.jsxs("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-2xl mx-4 flex flex-col",style:{height:"80vh"},children:[C.jsx("div",{className:"p-6 border-b border-gray-200",children:C.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"编辑 Extra Parameters"})}),C.jsxs("div",{className:"flex-grow p-6 overflow-y-auto",children:[C.jsxs("div",{className:"flex items-center border-b border-gray-200 mb-4",children:[s.map((D,M)=>C.jsxs("div",{className:`flex items-center px-4 py-2 border-b-2 cursor-pointer text-sm font-medium ${o===M?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,onDoubleClick:()=>{b(M),w(D.name)},onClick:()=>c(M),children:[m===M?C.jsx("input",{type:"text",value:x,onChange:F=>w(F.target.value),onBlur:()=>O(M),onKeyDown:F=>F.key==="Enter"&&O(M),className:"text-sm p-0 border-none focus:ring-0 bg-transparent",autoFocus:!0}):C.jsx("span",{children:D.name}),C.jsx("button",{onClick:F=>{F.stopPropagation(),A(M)},className:"ml-2 text-gray-400 hover:text-gray-600 w-4 h-4 flex items-center justify-center",children:"×"})]},M)),C.jsx("button",{onClick:k,className:"ml-2 px-3 py-1 text-sm text-gray-500 hover:text-gray-700",children:"+"})]}),C.jsx("textarea",{value:f,onChange:D=>{d(D.target.value),g(null)},className:"w-full h-full p-3 border border-gray-300 rounded-lg font-mono text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"}),p&&C.jsx("p",{className:"mt-2 text-sm text-red-600",children:p})]}),C.jsxs("div",{className:"flex justify-end gap-3 p-6 border-t border-gray-200 bg-gray-50 rounded-b-lg",children:[C.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"取消"}),C.jsx("button",{onClick:S,className:"px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"保存并使用"})]})]})})},fL=({isOpen:e,onClose:t,initialJson:n})=>{const[r,s]=W.useState(""),[l,o]=W.useState(null),[c,f]=W.useState([]);W.useEffect(()=>{if(e){let p="";if(n)if(typeof n=="string")p=n;else try{p=JSON.stringify(n,null,2)}catch(g){console.error("Failed to stringify initial JSON",g),p=""}else p=JSON.stringify([],null,2);s(p),o(null);try{d(p)}catch(g){console.error("Failed to parse initial JSON",g)}}},[e,n]);const d=p=>{try{const g=JSON.parse(p);let m=[];if(Array.isArray(g)?m=g:m=g.messages,!Array.isArray(m))throw new Error("JSON 格式无效,请检查后重试");f(m),o(null)}catch(g){o("JSON 格式无效,请检查后重试"),console.error("Invalid JSON format:",g)}};return W.useEffect(()=>{r&&d(r)},[r]),e?C.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:C.jsxs("div",{className:"bg-white rounded-lg shadow-xl w-[90%] max-w-[1200px] h-[80vh] max-h-[800px] flex flex-col overflow-hidden",children:[C.jsxs("div",{className:"flex justify-between items-center p-4 border-b border-gray-200",children:[C.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"JSON 消息预览"}),C.jsx("button",{onClick:t,className:"p-1.5 text-gray-500 hover:text-gray-900 transition-colors rounded-lg hover:bg-gray-100",children:C.jsx(XS,{className:"w-5 h-5"})})]}),C.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[C.jsxs("div",{className:"flex-1 p-4 flex flex-col border-r border-gray-200",children:[C.jsx("textarea",{value:r,onChange:p=>s(p.target.value),rows:20,placeholder:"输入JSON消息格式...",className:"flex-1 font-mono text-sm p-3 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none"}),l&&C.jsx("p",{className:"mt-2 text-sm text-red-600",children:l})]}),C.jsx("div",{className:"flex-1 p-4 overflow-y-auto bg-gray-50",children:C.jsx("div",{className:"bg-white rounded-lg p-4 min-h-full",children:(c==null?void 0:c.length)>0?C.jsx(gk,{renderMessages:c,collapsedTools:[],toggleToolCollapse:()=>{},client:null}):C.jsx("div",{className:"flex items-center justify-center h-full text-gray-500 italic",children:"请输入有效的JSON以查看消息预览"})})})]})]})}):null},dL=()=>{const[e,t]=W.useState(!1);return C.jsxs(C.Fragment,{children:[C.jsxs("button",{onClick:()=>t(!0),className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",children:[C.jsx(YS,{className:"w-4 h-4"}),"JSON 消息"]}),C.jsx(fL,{isOpen:e,onClose:()=>t(!1)})]})};function Ct(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Ct(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var hL={value:()=>{}};function Xc(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new lc(n)}function lc(e){this._=e}function pL(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}lc.prototype=Xc.prototype={constructor:lc,on:function(e,t){var n=this._,r=pL(e+"",n),s,l=-1,o=r.length;if(arguments.length<2){for(;++l<o;)if((s=(e=r[l]).type)&&(s=gL(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<o;)if(s=(e=r[l]).type)n[s]=S1(n[s],e.name,t);else if(t==null)for(s in n)n[s]=S1(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new lc(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,l;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],r=0,s=l.length;r<s;++r)l[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,l=r.length;s<l;++s)r[s].value.apply(t,n)}};function gL(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function S1(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=hL,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Hg="http://www.w3.org/1999/xhtml";const k1={svg:"http://www.w3.org/2000/svg",xhtml:Hg,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Qc(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),k1.hasOwnProperty(t)?{space:k1[t],local:e}:e}function mL(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Hg&&t.documentElement.namespaceURI===Hg?t.createElement(e):t.createElementNS(n,e)}}function yL(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function bk(e){var t=Qc(e);return(t.local?yL:mL)(t)}function bL(){}function Cm(e){return e==null?bL:function(){return this.querySelector(e)}}function vL(e){typeof e!="function"&&(e=Cm(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var l=t[s],o=l.length,c=r[s]=new Array(o),f,d,p=0;p<o;++p)(f=l[p])&&(d=e.call(f,f.__data__,p,l))&&("__data__"in f&&(d.__data__=f.__data__),c[p]=d);return new _n(r,this._parents)}function xL(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function wL(){return[]}function vk(e){return e==null?wL:function(){return this.querySelectorAll(e)}}function _L(e){return function(){return xL(e.apply(this,arguments))}}function SL(e){typeof e=="function"?e=_L(e):e=vk(e);for(var t=this._groups,n=t.length,r=[],s=[],l=0;l<n;++l)for(var o=t[l],c=o.length,f,d=0;d<c;++d)(f=o[d])&&(r.push(e.call(f,f.__data__,d,o)),s.push(f));return new _n(r,s)}function xk(e){return function(){return this.matches(e)}}function wk(e){return function(t){return t.matches(e)}}var kL=Array.prototype.find;function EL(e){return function(){return kL.call(this.children,e)}}function AL(){return this.firstElementChild}function TL(e){return this.select(e==null?AL:EL(typeof e=="function"?e:wk(e)))}var CL=Array.prototype.filter;function NL(){return Array.from(this.children)}function OL(e){return function(){return CL.call(this.children,e)}}function ML(e){return this.selectAll(e==null?NL:OL(typeof e=="function"?e:wk(e)))}function RL(e){typeof e!="function"&&(e=xk(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var l=t[s],o=l.length,c=r[s]=[],f,d=0;d<o;++d)(f=l[d])&&e.call(f,f.__data__,d,l)&&c.push(f);return new _n(r,this._parents)}function _k(e){return new Array(e.length)}function DL(){return new _n(this._enter||this._groups.map(_k),this._parents)}function kc(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}kc.prototype={constructor:kc,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function jL(e){return function(){return e}}function zL(e,t,n,r,s,l){for(var o=0,c,f=t.length,d=l.length;o<d;++o)(c=t[o])?(c.__data__=l[o],r[o]=c):n[o]=new kc(e,l[o]);for(;o<f;++o)(c=t[o])&&(s[o]=c)}function LL(e,t,n,r,s,l,o){var c,f,d=new Map,p=t.length,g=l.length,m=new Array(p),b;for(c=0;c<p;++c)(f=t[c])&&(m[c]=b=o.call(f,f.__data__,c,t)+"",d.has(b)?s[c]=f:d.set(b,f));for(c=0;c<g;++c)b=o.call(e,l[c],c,l)+"",(f=d.get(b))?(r[c]=f,f.__data__=l[c],d.delete(b)):n[c]=new kc(e,l[c]);for(c=0;c<p;++c)(f=t[c])&&d.get(m[c])===f&&(s[c]=f)}function IL(e){return e.__data__}function BL(e,t){if(!arguments.length)return Array.from(this,IL);var n=t?LL:zL,r=this._parents,s=this._groups;typeof e!="function"&&(e=jL(e));for(var l=s.length,o=new Array(l),c=new Array(l),f=new Array(l),d=0;d<l;++d){var p=r[d],g=s[d],m=g.length,b=FL(e.call(p,p&&p.__data__,d,r)),x=b.length,w=c[d]=new Array(x),_=o[d]=new Array(x),k=f[d]=new Array(m);n(p,g,w,_,k,b,t);for(var A=0,S=0,O,D;A<x;++A)if(O=w[A]){for(A>=S&&(S=A+1);!(D=_[S])&&++S<x;);O._next=D||null}}return o=new _n(o,r),o._enter=c,o._exit=f,o}function FL(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function PL(){return new _n(this._exit||this._groups.map(_k),this._parents)}function UL(e,t,n){var r=this.enter(),s=this,l=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?l.remove():n(l),r&&s?r.merge(s).order():s}function HL(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,l=r.length,o=Math.min(s,l),c=new Array(s),f=0;f<o;++f)for(var d=n[f],p=r[f],g=d.length,m=c[f]=new Array(g),b,x=0;x<g;++x)(b=d[x]||p[x])&&(m[x]=b);for(;f<s;++f)c[f]=n[f];return new _n(c,this._parents)}function $L(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],s=r.length-1,l=r[s],o;--s>=0;)(o=r[s])&&(l&&o.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(o,l),l=o);return this}function VL(e){e||(e=qL);function t(g,m){return g&&m?e(g.__data__,m.__data__):!g-!m}for(var n=this._groups,r=n.length,s=new Array(r),l=0;l<r;++l){for(var o=n[l],c=o.length,f=s[l]=new Array(c),d,p=0;p<c;++p)(d=o[p])&&(f[p]=d);f.sort(t)}return new _n(s,this._parents).order()}function qL(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function GL(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ZL(){return Array.from(this)}function YL(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,l=r.length;s<l;++s){var o=r[s];if(o)return o}return null}function XL(){let e=0;for(const t of this)++e;return e}function QL(){return!this.node()}function KL(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],l=0,o=s.length,c;l<o;++l)(c=s[l])&&e.call(c,c.__data__,l,s);return this}function JL(e){return function(){this.removeAttribute(e)}}function WL(e){return function(){this.removeAttributeNS(e.space,e.local)}}function e9(e,t){return function(){this.setAttribute(e,t)}}function t9(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function n9(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function r9(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function i9(e,t){var n=Qc(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?WL:JL:typeof t=="function"?n.local?r9:n9:n.local?t9:e9)(n,t))}function Sk(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function a9(e){return function(){this.style.removeProperty(e)}}function s9(e,t,n){return function(){this.style.setProperty(e,t,n)}}function l9(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function o9(e,t,n){return arguments.length>1?this.each((t==null?a9:typeof t=="function"?l9:s9)(e,t,n??"")):hs(this.node(),e)}function hs(e,t){return e.style.getPropertyValue(t)||Sk(e).getComputedStyle(e,null).getPropertyValue(t)}function u9(e){return function(){delete this[e]}}function c9(e,t){return function(){this[e]=t}}function f9(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function d9(e,t){return arguments.length>1?this.each((t==null?u9:typeof t=="function"?f9:c9)(e,t)):this.node()[e]}function kk(e){return e.trim().split(/^|\s+/)}function Nm(e){return e.classList||new Ek(e)}function Ek(e){this._node=e,this._names=kk(e.getAttribute("class")||"")}Ek.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Ak(e,t){for(var n=Nm(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function Tk(e,t){for(var n=Nm(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function h9(e){return function(){Ak(this,e)}}function p9(e){return function(){Tk(this,e)}}function g9(e,t){return function(){(t.apply(this,arguments)?Ak:Tk)(this,e)}}function m9(e,t){var n=kk(e+"");if(arguments.length<2){for(var r=Nm(this.node()),s=-1,l=n.length;++s<l;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?g9:t?h9:p9)(n,t))}function y9(){this.textContent=""}function b9(e){return function(){this.textContent=e}}function v9(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function x9(e){return arguments.length?this.each(e==null?y9:(typeof e=="function"?v9:b9)(e)):this.node().textContent}function w9(){this.innerHTML=""}function _9(e){return function(){this.innerHTML=e}}function S9(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function k9(e){return arguments.length?this.each(e==null?w9:(typeof e=="function"?S9:_9)(e)):this.node().innerHTML}function E9(){this.nextSibling&&this.parentNode.appendChild(this)}function A9(){return this.each(E9)}function T9(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function C9(){return this.each(T9)}function N9(e){var t=typeof e=="function"?e:bk(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function O9(){return null}function M9(e,t){var n=typeof e=="function"?e:bk(e),r=t==null?O9:typeof t=="function"?t:Cm(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function R9(){var e=this.parentNode;e&&e.removeChild(this)}function D9(){return this.each(R9)}function j9(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function z9(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function L9(e){return this.select(e?z9:j9)}function I9(e){return arguments.length?this.property("__data__",e):this.node().__data__}function B9(e){return function(t){e.call(this,t,this.__data__)}}function F9(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function P9(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,l;n<s;++n)l=t[n],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++r]=l;++r?t.length=r:delete this.__on}}}function U9(e,t,n){return function(){var r=this.__on,s,l=B9(t);if(r){for(var o=0,c=r.length;o<c;++o)if((s=r[o]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=l,s.options=n),s.value=t;return}}this.addEventListener(e.type,l,n),s={type:e.type,name:e.name,value:t,listener:l,options:n},r?r.push(s):this.__on=[s]}}function H9(e,t,n){var r=F9(e+""),s,l=r.length,o;if(arguments.length<2){var c=this.node().__on;if(c){for(var f=0,d=c.length,p;f<d;++f)for(s=0,p=c[f];s<l;++s)if((o=r[s]).type===p.type&&o.name===p.name)return p.value}return}for(c=t?U9:P9,s=0;s<l;++s)this.each(c(r[s],t,n));return this}function Ck(e,t,n){var r=Sk(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,n):(s=r.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function $9(e,t){return function(){return Ck(this,e,t)}}function V9(e,t){return function(){return Ck(this,e,t.apply(this,arguments))}}function q9(e,t){return this.each((typeof t=="function"?V9:$9)(e,t))}function*G9(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,l=r.length,o;s<l;++s)(o=r[s])&&(yield o)}var Nk=[null];function _n(e,t){this._groups=e,this._parents=t}function co(){return new _n([[document.documentElement]],Nk)}function Z9(){return this}_n.prototype=co.prototype={constructor:_n,select:vL,selectAll:SL,selectChild:TL,selectChildren:ML,filter:RL,data:BL,enter:DL,exit:PL,join:UL,merge:HL,selection:Z9,order:$L,sort:VL,call:GL,nodes:ZL,node:YL,size:XL,empty:QL,each:KL,attr:i9,style:o9,property:d9,classed:m9,text:x9,html:k9,raise:A9,lower:C9,append:N9,insert:M9,remove:D9,clone:L9,datum:I9,on:H9,dispatch:q9,[Symbol.iterator]:G9};function vn(e){return typeof e=="string"?new _n([[document.querySelector(e)]],[document.documentElement]):new _n([[e]],Nk)}function Y9(e){let t;for(;t=e.sourceEvent;)e=t;return e}function $n(e,t){if(e=Y9(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const X9={passive:!1},Ql={capture:!0,passive:!1};function op(e){e.stopImmediatePropagation()}function is(e){e.preventDefault(),e.stopImmediatePropagation()}function Ok(e){var t=e.document.documentElement,n=vn(e).on("dragstart.drag",is,Ql);"onselectstart"in t?n.on("selectstart.drag",is,Ql):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Mk(e,t){var n=e.document.documentElement,r=vn(e).on("dragstart.drag",null);t&&(r.on("click.drag",is,Ql),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Zu=e=>()=>e;function $g(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:l,x:o,y:c,dx:f,dy:d,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:p}})}$g.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Q9(e){return!e.ctrlKey&&!e.button}function K9(){return this.parentNode}function J9(e,t){return t??{x:e.x,y:e.y}}function W9(){return navigator.maxTouchPoints||"ontouchstart"in this}function Rk(){var e=Q9,t=K9,n=J9,r=W9,s={},l=Xc("start","drag","end"),o=0,c,f,d,p,g=0;function m(O){O.on("mousedown.drag",b).filter(r).on("touchstart.drag",_).on("touchmove.drag",k,X9).on("touchend.drag touchcancel.drag",A).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(O,D){if(!(p||!e.call(this,O,D))){var M=S(this,t.call(this,O,D),O,D,"mouse");M&&(vn(O.view).on("mousemove.drag",x,Ql).on("mouseup.drag",w,Ql),Ok(O.view),op(O),d=!1,c=O.clientX,f=O.clientY,M("start",O))}}function x(O){if(is(O),!d){var D=O.clientX-c,M=O.clientY-f;d=D*D+M*M>g}s.mouse("drag",O)}function w(O){vn(O.view).on("mousemove.drag mouseup.drag",null),Mk(O.view,d),is(O),s.mouse("end",O)}function _(O,D){if(e.call(this,O,D)){var M=O.changedTouches,F=t.call(this,O,D),L=M.length,U,j;for(U=0;U<L;++U)(j=S(this,F,O,D,M[U].identifier,M[U]))&&(op(O),j("start",O,M[U]))}}function k(O){var D=O.changedTouches,M=D.length,F,L;for(F=0;F<M;++F)(L=s[D[F].identifier])&&(is(O),L("drag",O,D[F]))}function A(O){var D=O.changedTouches,M=D.length,F,L;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),F=0;F<M;++F)(L=s[D[F].identifier])&&(op(O),L("end",O,D[F]))}function S(O,D,M,F,L,U){var j=l.copy(),H=$n(U||M,D),B,q,R;if((R=n.call(O,new $g("beforestart",{sourceEvent:M,target:m,identifier:L,active:o,x:H[0],y:H[1],dx:0,dy:0,dispatch:j}),F))!=null)return B=R.x-H[0]||0,q=R.y-H[1]||0,function $(I,P,Y){var X=H,E;switch(I){case"start":s[L]=$,E=o++;break;case"end":delete s[L],--o;case"drag":H=$n(Y||P,D),E=o;break}j.call(I,O,new $g(I,{sourceEvent:P,subject:R,target:m,identifier:L,active:E,x:H[0]+B,y:H[1]+q,dx:H[0]-X[0],dy:H[1]-X[1],dispatch:j}),F)}}return m.filter=function(O){return arguments.length?(e=typeof O=="function"?O:Zu(!!O),m):e},m.container=function(O){return arguments.length?(t=typeof O=="function"?O:Zu(O),m):t},m.subject=function(O){return arguments.length?(n=typeof O=="function"?O:Zu(O),m):n},m.touchable=function(O){return arguments.length?(r=typeof O=="function"?O:Zu(!!O),m):r},m.on=function(){var O=l.on.apply(l,arguments);return O===l?m:O},m.clickDistance=function(O){return arguments.length?(g=(O=+O)*O,m):Math.sqrt(g)},m}function Om(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Dk(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function fo(){}var Kl=.7,Ec=1/Kl,as="\\s*([+-]?\\d+)\\s*",Jl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",lr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",eI=/^#([0-9a-f]{3,8})$/,tI=new RegExp(`^rgb\\(${as},${as},${as}\\)$`),nI=new RegExp(`^rgb\\(${lr},${lr},${lr}\\)$`),rI=new RegExp(`^rgba\\(${as},${as},${as},${Jl}\\)$`),iI=new RegExp(`^rgba\\(${lr},${lr},${lr},${Jl}\\)$`),aI=new RegExp(`^hsl\\(${Jl},${lr},${lr}\\)$`),sI=new RegExp(`^hsla\\(${Jl},${lr},${lr},${Jl}\\)$`),E1={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Om(fo,Wl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:A1,formatHex:A1,formatHex8:lI,formatHsl:oI,formatRgb:T1,toString:T1});function A1(){return this.rgb().formatHex()}function lI(){return this.rgb().formatHex8()}function oI(){return jk(this).formatHsl()}function T1(){return this.rgb().formatRgb()}function Wl(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=eI.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?C1(t):n===3?new ln(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Yu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Yu(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=tI.exec(e))?new ln(t[1],t[2],t[3],1):(t=nI.exec(e))?new ln(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=rI.exec(e))?Yu(t[1],t[2],t[3],t[4]):(t=iI.exec(e))?Yu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=aI.exec(e))?M1(t[1],t[2]/100,t[3]/100,1):(t=sI.exec(e))?M1(t[1],t[2]/100,t[3]/100,t[4]):E1.hasOwnProperty(e)?C1(E1[e]):e==="transparent"?new ln(NaN,NaN,NaN,0):null}function C1(e){return new ln(e>>16&255,e>>8&255,e&255,1)}function Yu(e,t,n,r){return r<=0&&(e=t=n=NaN),new ln(e,t,n,r)}function uI(e){return e instanceof fo||(e=Wl(e)),e?(e=e.rgb(),new ln(e.r,e.g,e.b,e.opacity)):new ln}function Vg(e,t,n,r){return arguments.length===1?uI(e):new ln(e,t,n,r??1)}function ln(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Om(ln,Vg,Dk(fo,{brighter(e){return e=e==null?Ec:Math.pow(Ec,e),new ln(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Kl:Math.pow(Kl,e),new ln(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ln(ta(this.r),ta(this.g),ta(this.b),Ac(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:N1,formatHex:N1,formatHex8:cI,formatRgb:O1,toString:O1}));function N1(){return`#${Ji(this.r)}${Ji(this.g)}${Ji(this.b)}`}function cI(){return`#${Ji(this.r)}${Ji(this.g)}${Ji(this.b)}${Ji((isNaN(this.opacity)?1:this.opacity)*255)}`}function O1(){const e=Ac(this.opacity);return`${e===1?"rgb(":"rgba("}${ta(this.r)}, ${ta(this.g)}, ${ta(this.b)}${e===1?")":`, ${e})`}`}function Ac(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ta(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ji(e){return e=ta(e),(e<16?"0":"")+e.toString(16)}function M1(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Vn(e,t,n,r)}function jk(e){if(e instanceof Vn)return new Vn(e.h,e.s,e.l,e.opacity);if(e instanceof fo||(e=Wl(e)),!e)return new Vn;if(e instanceof Vn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),l=Math.max(t,n,r),o=NaN,c=l-s,f=(l+s)/2;return c?(t===l?o=(n-r)/c+(n<r)*6:n===l?o=(r-t)/c+2:o=(t-n)/c+4,c/=f<.5?l+s:2-l-s,o*=60):c=f>0&&f<1?0:o,new Vn(o,c,f,e.opacity)}function fI(e,t,n,r){return arguments.length===1?jk(e):new Vn(e,t,n,r??1)}function Vn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Om(Vn,fI,Dk(fo,{brighter(e){return e=e==null?Ec:Math.pow(Ec,e),new Vn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Kl:Math.pow(Kl,e),new Vn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new ln(up(e>=240?e-240:e+120,s,r),up(e,s,r),up(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Vn(R1(this.h),Xu(this.s),Xu(this.l),Ac(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ac(this.opacity);return`${e===1?"hsl(":"hsla("}${R1(this.h)}, ${Xu(this.s)*100}%, ${Xu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function R1(e){return e=(e||0)%360,e<0?e+360:e}function Xu(e){return Math.max(0,Math.min(1,e||0))}function up(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const zk=e=>()=>e;function dI(e,t){return function(n){return e+n*t}}function hI(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function pI(e){return(e=+e)==1?Lk:function(t,n){return n-t?hI(t,n,e):zk(isNaN(t)?n:t)}}function Lk(e,t){var n=t-e;return n?dI(e,n):zk(isNaN(e)?t:e)}const D1=function e(t){var n=pI(t);function r(s,l){var o=n((s=Vg(s)).r,(l=Vg(l)).r),c=n(s.g,l.g),f=n(s.b,l.b),d=Lk(s.opacity,l.opacity);return function(p){return s.r=o(p),s.g=c(p),s.b=f(p),s.opacity=d(p),s+""}}return r.gamma=e,r}(1);function yi(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var qg=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,cp=new RegExp(qg.source,"g");function gI(e){return function(){return e}}function mI(e){return function(t){return e(t)+""}}function yI(e,t){var n=qg.lastIndex=cp.lastIndex=0,r,s,l,o=-1,c=[],f=[];for(e=e+"",t=t+"";(r=qg.exec(e))&&(s=cp.exec(t));)(l=s.index)>n&&(l=t.slice(n,l),c[o]?c[o]+=l:c[++o]=l),(r=r[0])===(s=s[0])?c[o]?c[o]+=s:c[++o]=s:(c[++o]=null,f.push({i:o,x:yi(r,s)})),n=cp.lastIndex;return n<t.length&&(l=t.slice(n),c[o]?c[o]+=l:c[++o]=l),c.length<2?f[0]?mI(f[0].x):gI(t):(t=f.length,function(d){for(var p=0,g;p<t;++p)c[(g=f[p]).i]=g.x(d);return c.join("")})}var j1=180/Math.PI,Gg={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ik(e,t,n,r,s,l){var o,c,f;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(f=e*n+t*r)&&(n-=e*f,r-=t*f),(c=Math.sqrt(n*n+r*r))&&(n/=c,r/=c,f/=c),e*r<t*n&&(e=-e,t=-t,f=-f,o=-o),{translateX:s,translateY:l,rotate:Math.atan2(t,e)*j1,skewX:Math.atan(f)*j1,scaleX:o,scaleY:c}}var Qu;function bI(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Gg:Ik(t.a,t.b,t.c,t.d,t.e,t.f)}function vI(e){return e==null||(Qu||(Qu=document.createElementNS("http://www.w3.org/2000/svg","g")),Qu.setAttribute("transform",e),!(e=Qu.transform.baseVal.consolidate()))?Gg:(e=e.matrix,Ik(e.a,e.b,e.c,e.d,e.e,e.f))}function Bk(e,t,n,r){function s(d){return d.length?d.pop()+" ":""}function l(d,p,g,m,b,x){if(d!==g||p!==m){var w=b.push("translate(",null,t,null,n);x.push({i:w-4,x:yi(d,g)},{i:w-2,x:yi(p,m)})}else(g||m)&&b.push("translate("+g+t+m+n)}function o(d,p,g,m){d!==p?(d-p>180?p+=360:p-d>180&&(d+=360),m.push({i:g.push(s(g)+"rotate(",null,r)-2,x:yi(d,p)})):p&&g.push(s(g)+"rotate("+p+r)}function c(d,p,g,m){d!==p?m.push({i:g.push(s(g)+"skewX(",null,r)-2,x:yi(d,p)}):p&&g.push(s(g)+"skewX("+p+r)}function f(d,p,g,m,b,x){if(d!==g||p!==m){var w=b.push(s(b)+"scale(",null,",",null,")");x.push({i:w-4,x:yi(d,g)},{i:w-2,x:yi(p,m)})}else(g!==1||m!==1)&&b.push(s(b)+"scale("+g+","+m+")")}return function(d,p){var g=[],m=[];return d=e(d),p=e(p),l(d.translateX,d.translateY,p.translateX,p.translateY,g,m),o(d.rotate,p.rotate,g,m),c(d.skewX,p.skewX,g,m),f(d.scaleX,d.scaleY,p.scaleX,p.scaleY,g,m),d=p=null,function(b){for(var x=-1,w=m.length,_;++x<w;)g[(_=m[x]).i]=_.x(b);return g.join("")}}}var xI=Bk(bI,"px, ","px)","deg)"),wI=Bk(vI,", ",")",")"),_I=1e-12;function z1(e){return((e=Math.exp(e))+1/e)/2}function SI(e){return((e=Math.exp(e))-1/e)/2}function kI(e){return((e=Math.exp(2*e))-1)/(e+1)}const EI=function e(t,n,r){function s(l,o){var c=l[0],f=l[1],d=l[2],p=o[0],g=o[1],m=o[2],b=p-c,x=g-f,w=b*b+x*x,_,k;if(w<_I)k=Math.log(m/d)/t,_=function(F){return[c+F*b,f+F*x,d*Math.exp(t*F*k)]};else{var A=Math.sqrt(w),S=(m*m-d*d+r*w)/(2*d*n*A),O=(m*m-d*d-r*w)/(2*m*n*A),D=Math.log(Math.sqrt(S*S+1)-S),M=Math.log(Math.sqrt(O*O+1)-O);k=(M-D)/t,_=function(F){var L=F*k,U=z1(D),j=d/(n*A)*(U*kI(t*L+D)-SI(D));return[c+j*b,f+j*x,d*U/z1(t*L+D)]}}return _.duration=k*1e3*t/Math.SQRT2,_}return s.rho=function(l){var o=Math.max(.001,+l),c=o*o,f=c*c;return e(o,c,f)},s}(Math.SQRT2,2,4);var ps=0,Il=0,Dl=0,Fk=1e3,Tc,Bl,Cc=0,aa=0,Kc=0,eo=typeof performance=="object"&&performance.now?performance:Date,Pk=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Mm(){return aa||(Pk(AI),aa=eo.now()+Kc)}function AI(){aa=0}function Nc(){this._call=this._time=this._next=null}Nc.prototype=Uk.prototype={constructor:Nc,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Mm():+n)+(t==null?0:+t),!this._next&&Bl!==this&&(Bl?Bl._next=this:Tc=this,Bl=this),this._call=e,this._time=n,Zg()},stop:function(){this._call&&(this._call=null,this._time=1/0,Zg())}};function Uk(e,t,n){var r=new Nc;return r.restart(e,t,n),r}function TI(){Mm(),++ps;for(var e=Tc,t;e;)(t=aa-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ps}function L1(){aa=(Cc=eo.now())+Kc,ps=Il=0;try{TI()}finally{ps=0,NI(),aa=0}}function CI(){var e=eo.now(),t=e-Cc;t>Fk&&(Kc-=t,Cc=e)}function NI(){for(var e,t=Tc,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Tc=n);Bl=e,Zg(r)}function Zg(e){if(!ps){Il&&(Il=clearTimeout(Il));var t=e-aa;t>24?(e<1/0&&(Il=setTimeout(L1,e-eo.now()-Kc)),Dl&&(Dl=clearInterval(Dl))):(Dl||(Cc=eo.now(),Dl=setInterval(CI,Fk)),ps=1,Pk(L1))}}function I1(e,t,n){var r=new Nc;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var OI=Xc("start","end","cancel","interrupt"),MI=[],Hk=0,B1=1,Yg=2,oc=3,F1=4,Xg=5,uc=6;function Jc(e,t,n,r,s,l){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;RI(e,n,{name:t,index:r,group:s,on:OI,tween:MI,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:Hk})}function Rm(e,t){var n=Yn(e,t);if(n.state>Hk)throw new Error("too late; already scheduled");return n}function cr(e,t){var n=Yn(e,t);if(n.state>oc)throw new Error("too late; already running");return n}function Yn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function RI(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=Uk(l,0,n.time);function l(d){n.state=B1,n.timer.restart(o,n.delay,n.time),n.delay<=d&&o(d-n.delay)}function o(d){var p,g,m,b;if(n.state!==B1)return f();for(p in r)if(b=r[p],b.name===n.name){if(b.state===oc)return I1(o);b.state===F1?(b.state=uc,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete r[p]):+p<t&&(b.state=uc,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete r[p])}if(I1(function(){n.state===oc&&(n.state=F1,n.timer.restart(c,n.delay,n.time),c(d))}),n.state=Yg,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Yg){for(n.state=oc,s=new Array(m=n.tween.length),p=0,g=-1;p<m;++p)(b=n.tween[p].value.call(e,e.__data__,n.index,n.group))&&(s[++g]=b);s.length=g+1}}function c(d){for(var p=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(f),n.state=Xg,1),g=-1,m=s.length;++g<m;)s[g].call(e,p);n.state===Xg&&(n.on.call("end",e,e.__data__,n.index,n.group),f())}function f(){n.state=uc,n.timer.stop(),delete r[t];for(var d in r)return;delete e.__transition}}function cc(e,t){var n=e.__transition,r,s,l=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){l=!1;continue}s=r.state>Yg&&r.state<Xg,r.state=uc,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}l&&delete e.__transition}}function DI(e){return this.each(function(){cc(this,e)})}function jI(e,t){var n,r;return function(){var s=cr(this,e),l=s.tween;if(l!==n){r=n=l;for(var o=0,c=r.length;o<c;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}s.tween=r}}function zI(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var l=cr(this,e),o=l.tween;if(o!==r){s=(r=o).slice();for(var c={name:t,value:n},f=0,d=s.length;f<d;++f)if(s[f].name===t){s[f]=c;break}f===d&&s.push(c)}l.tween=s}}function LI(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Yn(this.node(),n).tween,s=0,l=r.length,o;s<l;++s)if((o=r[s]).name===e)return o.value;return null}return this.each((t==null?jI:zI)(n,e,t))}function Dm(e,t,n){var r=e._id;return e.each(function(){var s=cr(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return Yn(s,r).value[t]}}function $k(e,t){var n;return(typeof t=="number"?yi:t instanceof Wl?D1:(n=Wl(t))?(t=n,D1):yI)(e,t)}function II(e){return function(){this.removeAttribute(e)}}function BI(e){return function(){this.removeAttributeNS(e.space,e.local)}}function FI(e,t,n){var r,s=n+"",l;return function(){var o=this.getAttribute(e);return o===s?null:o===r?l:l=t(r=o,n)}}function PI(e,t,n){var r,s=n+"",l;return function(){var o=this.getAttributeNS(e.space,e.local);return o===s?null:o===r?l:l=t(r=o,n)}}function UI(e,t,n){var r,s,l;return function(){var o,c=n(this),f;return c==null?void this.removeAttribute(e):(o=this.getAttribute(e),f=c+"",o===f?null:o===r&&f===s?l:(s=f,l=t(r=o,c)))}}function HI(e,t,n){var r,s,l;return function(){var o,c=n(this),f;return c==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),f=c+"",o===f?null:o===r&&f===s?l:(s=f,l=t(r=o,c)))}}function $I(e,t){var n=Qc(e),r=n==="transform"?wI:$k;return this.attrTween(e,typeof t=="function"?(n.local?HI:UI)(n,r,Dm(this,"attr."+e,t)):t==null?(n.local?BI:II)(n):(n.local?PI:FI)(n,r,t))}function VI(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function qI(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function GI(e,t){var n,r;function s(){var l=t.apply(this,arguments);return l!==r&&(n=(r=l)&&qI(e,l)),n}return s._value=t,s}function ZI(e,t){var n,r;function s(){var l=t.apply(this,arguments);return l!==r&&(n=(r=l)&&VI(e,l)),n}return s._value=t,s}function YI(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Qc(e);return this.tween(n,(r.local?GI:ZI)(r,t))}function XI(e,t){return function(){Rm(this,e).delay=+t.apply(this,arguments)}}function QI(e,t){return t=+t,function(){Rm(this,e).delay=t}}function KI(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?XI:QI)(t,e)):Yn(this.node(),t).delay}function JI(e,t){return function(){cr(this,e).duration=+t.apply(this,arguments)}}function WI(e,t){return t=+t,function(){cr(this,e).duration=t}}function e6(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?JI:WI)(t,e)):Yn(this.node(),t).duration}function t6(e,t){if(typeof t!="function")throw new Error;return function(){cr(this,e).ease=t}}function n6(e){var t=this._id;return arguments.length?this.each(t6(t,e)):Yn(this.node(),t).ease}function r6(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;cr(this,e).ease=n}}function i6(e){if(typeof e!="function")throw new Error;return this.each(r6(this._id,e))}function a6(e){typeof e!="function"&&(e=xk(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var l=t[s],o=l.length,c=r[s]=[],f,d=0;d<o;++d)(f=l[d])&&e.call(f,f.__data__,d,l)&&c.push(f);return new zr(r,this._parents,this._name,this._id)}function s6(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,s=n.length,l=Math.min(r,s),o=new Array(r),c=0;c<l;++c)for(var f=t[c],d=n[c],p=f.length,g=o[c]=new Array(p),m,b=0;b<p;++b)(m=f[b]||d[b])&&(g[b]=m);for(;c<r;++c)o[c]=t[c];return new zr(o,this._parents,this._name,this._id)}function l6(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function o6(e,t,n){var r,s,l=l6(t)?Rm:cr;return function(){var o=l(this,e),c=o.on;c!==r&&(s=(r=c).copy()).on(t,n),o.on=s}}function u6(e,t){var n=this._id;return arguments.length<2?Yn(this.node(),n).on.on(e):this.each(o6(n,e,t))}function c6(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function f6(){return this.on("end.remove",c6(this._id))}function d6(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Cm(e));for(var r=this._groups,s=r.length,l=new Array(s),o=0;o<s;++o)for(var c=r[o],f=c.length,d=l[o]=new Array(f),p,g,m=0;m<f;++m)(p=c[m])&&(g=e.call(p,p.__data__,m,c))&&("__data__"in p&&(g.__data__=p.__data__),d[m]=g,Jc(d[m],t,n,m,d,Yn(p,n)));return new zr(l,this._parents,t,n)}function h6(e){var t=this._name,n=this._id;typeof e!="function"&&(e=vk(e));for(var r=this._groups,s=r.length,l=[],o=[],c=0;c<s;++c)for(var f=r[c],d=f.length,p,g=0;g<d;++g)if(p=f[g]){for(var m=e.call(p,p.__data__,g,f),b,x=Yn(p,n),w=0,_=m.length;w<_;++w)(b=m[w])&&Jc(b,t,n,w,m,x);l.push(m),o.push(p)}return new zr(l,o,t,n)}var p6=co.prototype.constructor;function g6(){return new p6(this._groups,this._parents)}function m6(e,t){var n,r,s;return function(){var l=hs(this,e),o=(this.style.removeProperty(e),hs(this,e));return l===o?null:l===n&&o===r?s:s=t(n=l,r=o)}}function Vk(e){return function(){this.style.removeProperty(e)}}function y6(e,t,n){var r,s=n+"",l;return function(){var o=hs(this,e);return o===s?null:o===r?l:l=t(r=o,n)}}function b6(e,t,n){var r,s,l;return function(){var o=hs(this,e),c=n(this),f=c+"";return c==null&&(f=c=(this.style.removeProperty(e),hs(this,e))),o===f?null:o===r&&f===s?l:(s=f,l=t(r=o,c))}}function v6(e,t){var n,r,s,l="style."+t,o="end."+l,c;return function(){var f=cr(this,e),d=f.on,p=f.value[l]==null?c||(c=Vk(t)):void 0;(d!==n||s!==p)&&(r=(n=d).copy()).on(o,s=p),f.on=r}}function x6(e,t,n){var r=(e+="")=="transform"?xI:$k;return t==null?this.styleTween(e,m6(e,r)).on("end.style."+e,Vk(e)):typeof t=="function"?this.styleTween(e,b6(e,r,Dm(this,"style."+e,t))).each(v6(this._id,e)):this.styleTween(e,y6(e,r,t),n).on("end.style."+e,null)}function w6(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function _6(e,t,n){var r,s;function l(){var o=t.apply(this,arguments);return o!==s&&(r=(s=o)&&w6(e,o,n)),r}return l._value=t,l}function S6(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,_6(e,t,n??""))}function k6(e){return function(){this.textContent=e}}function E6(e){return function(){var t=e(this);this.textContent=t??""}}function A6(e){return this.tween("text",typeof e=="function"?E6(Dm(this,"text",e)):k6(e==null?"":e+""))}function T6(e){return function(t){this.textContent=e.call(this,t)}}function C6(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&T6(s)),t}return r._value=e,r}function N6(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,C6(e))}function O6(){for(var e=this._name,t=this._id,n=qk(),r=this._groups,s=r.length,l=0;l<s;++l)for(var o=r[l],c=o.length,f,d=0;d<c;++d)if(f=o[d]){var p=Yn(f,t);Jc(f,e,n,d,o,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new zr(r,this._parents,e,n)}function M6(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(l,o){var c={value:o},f={value:function(){--s===0&&l()}};n.each(function(){var d=cr(this,r),p=d.on;p!==e&&(t=(e=p).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(f)),d.on=t}),s===0&&l()})}var R6=0;function zr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function qk(){return++R6}var Or=co.prototype;zr.prototype={constructor:zr,select:d6,selectAll:h6,selectChild:Or.selectChild,selectChildren:Or.selectChildren,filter:a6,merge:s6,selection:g6,transition:O6,call:Or.call,nodes:Or.nodes,node:Or.node,size:Or.size,empty:Or.empty,each:Or.each,on:u6,attr:$I,attrTween:YI,style:x6,styleTween:S6,text:A6,textTween:N6,remove:f6,tween:LI,delay:KI,duration:e6,ease:n6,easeVarying:i6,end:M6,[Symbol.iterator]:Or[Symbol.iterator]};function D6(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var j6={time:null,delay:0,duration:250,ease:D6};function z6(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function L6(e){var t,n;e instanceof zr?(t=e._id,e=e._name):(t=qk(),(n=j6).time=Mm(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,l=0;l<s;++l)for(var o=r[l],c=o.length,f,d=0;d<c;++d)(f=o[d])&&Jc(f,e,t,d,o,n||z6(f,t));return new zr(r,this._parents,e,t)}co.prototype.interrupt=DI;co.prototype.transition=L6;const Ku=e=>()=>e;function I6(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Mr(e,t,n){this.k=e,this.x=t,this.y=n}Mr.prototype={constructor:Mr,scale:function(e){return e===1?this:new Mr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Mr(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Wc=new Mr(1,0,0);Gk.prototype=Mr.prototype;function Gk(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Wc;return e.__zoom}function fp(e){e.stopImmediatePropagation()}function jl(e){e.preventDefault(),e.stopImmediatePropagation()}function B6(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function F6(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function P1(){return this.__zoom||Wc}function P6(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function U6(){return navigator.maxTouchPoints||"ontouchstart"in this}function H6(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],l=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),o>l?(l+o)/2:Math.min(0,l)||Math.max(0,o))}function Zk(){var e=B6,t=F6,n=H6,r=P6,s=U6,l=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],c=250,f=EI,d=Xc("start","zoom","end"),p,g,m,b=500,x=150,w=0,_=10;function k(R){R.property("__zoom",P1).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",U).on("dblclick.zoom",j).filter(s).on("touchstart.zoom",H).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(R,$,I,P){var Y=R.selection?R.selection():R;Y.property("__zoom",P1),R!==Y?D(R,$,I,P):Y.interrupt().each(function(){M(this,arguments).event(P).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},k.scaleBy=function(R,$,I,P){k.scaleTo(R,function(){var Y=this.__zoom.k,X=typeof $=="function"?$.apply(this,arguments):$;return Y*X},I,P)},k.scaleTo=function(R,$,I,P){k.transform(R,function(){var Y=t.apply(this,arguments),X=this.__zoom,E=I==null?O(Y):typeof I=="function"?I.apply(this,arguments):I,G=X.invert(E),te=typeof $=="function"?$.apply(this,arguments):$;return n(S(A(X,te),E,G),Y,o)},I,P)},k.translateBy=function(R,$,I,P){k.transform(R,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof I=="function"?I.apply(this,arguments):I),t.apply(this,arguments),o)},null,P)},k.translateTo=function(R,$,I,P,Y){k.transform(R,function(){var X=t.apply(this,arguments),E=this.__zoom,G=P==null?O(X):typeof P=="function"?P.apply(this,arguments):P;return n(Wc.translate(G[0],G[1]).scale(E.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof I=="function"?-I.apply(this,arguments):-I),X,o)},P,Y)};function A(R,$){return $=Math.max(l[0],Math.min(l[1],$)),$===R.k?R:new Mr($,R.x,R.y)}function S(R,$,I){var P=$[0]-I[0]*R.k,Y=$[1]-I[1]*R.k;return P===R.x&&Y===R.y?R:new Mr(R.k,P,Y)}function O(R){return[(+R[0][0]+ +R[1][0])/2,(+R[0][1]+ +R[1][1])/2]}function D(R,$,I,P){R.on("start.zoom",function(){M(this,arguments).event(P).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event(P).end()}).tween("zoom",function(){var Y=this,X=arguments,E=M(Y,X).event(P),G=t.apply(Y,X),te=I==null?O(G):typeof I=="function"?I.apply(Y,X):I,T=Math.max(G[1][0]-G[0][0],G[1][1]-G[0][1]),V=Y.__zoom,K=typeof $=="function"?$.apply(Y,X):$,J=f(V.invert(te).concat(T/V.k),K.invert(te).concat(T/K.k));return function(le){if(le===1)le=K;else{var fe=J(le),ye=T/fe[2];le=new Mr(ye,te[0]-fe[0]*ye,te[1]-fe[1]*ye)}E.zoom(null,le)}})}function M(R,$,I){return!I&&R.__zooming||new F(R,$)}function F(R,$){this.that=R,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(R,$),this.taps=0}F.prototype={event:function(R){return R&&(this.sourceEvent=R),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(R,$){return this.mouse&&R!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&R!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(R){var $=vn(this.that).datum();d.call(R,this.that,new I6(R,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:d}),$)}};function L(R,...$){if(!e.apply(this,arguments))return;var I=M(this,$).event(R),P=this.__zoom,Y=Math.max(l[0],Math.min(l[1],P.k*Math.pow(2,r.apply(this,arguments)))),X=$n(R);if(I.wheel)(I.mouse[0][0]!==X[0]||I.mouse[0][1]!==X[1])&&(I.mouse[1]=P.invert(I.mouse[0]=X)),clearTimeout(I.wheel);else{if(P.k===Y)return;I.mouse=[X,P.invert(X)],cc(this),I.start()}jl(R),I.wheel=setTimeout(E,x),I.zoom("mouse",n(S(A(P,Y),I.mouse[0],I.mouse[1]),I.extent,o));function E(){I.wheel=null,I.end()}}function U(R,...$){if(m||!e.apply(this,arguments))return;var I=R.currentTarget,P=M(this,$,!0).event(R),Y=vn(R.view).on("mousemove.zoom",te,!0).on("mouseup.zoom",T,!0),X=$n(R,I),E=R.clientX,G=R.clientY;Ok(R.view),fp(R),P.mouse=[X,this.__zoom.invert(X)],cc(this),P.start();function te(V){if(jl(V),!P.moved){var K=V.clientX-E,J=V.clientY-G;P.moved=K*K+J*J>w}P.event(V).zoom("mouse",n(S(P.that.__zoom,P.mouse[0]=$n(V,I),P.mouse[1]),P.extent,o))}function T(V){Y.on("mousemove.zoom mouseup.zoom",null),Mk(V.view,P.moved),jl(V),P.event(V).end()}}function j(R,...$){if(e.apply(this,arguments)){var I=this.__zoom,P=$n(R.changedTouches?R.changedTouches[0]:R,this),Y=I.invert(P),X=I.k*(R.shiftKey?.5:2),E=n(S(A(I,X),P,Y),t.apply(this,$),o);jl(R),c>0?vn(this).transition().duration(c).call(D,E,P,R):vn(this).call(k.transform,E,P,R)}}function H(R,...$){if(e.apply(this,arguments)){var I=R.touches,P=I.length,Y=M(this,$,R.changedTouches.length===P).event(R),X,E,G,te;for(fp(R),E=0;E<P;++E)G=I[E],te=$n(G,this),te=[te,this.__zoom.invert(te),G.identifier],Y.touch0?!Y.touch1&&Y.touch0[2]!==te[2]&&(Y.touch1=te,Y.taps=0):(Y.touch0=te,X=!0,Y.taps=1+!!p);p&&(p=clearTimeout(p)),X&&(Y.taps<2&&(g=te[0],p=setTimeout(function(){p=null},b)),cc(this),Y.start())}}function B(R,...$){if(this.__zooming){var I=M(this,$).event(R),P=R.changedTouches,Y=P.length,X,E,G,te;for(jl(R),X=0;X<Y;++X)E=P[X],G=$n(E,this),I.touch0&&I.touch0[2]===E.identifier?I.touch0[0]=G:I.touch1&&I.touch1[2]===E.identifier&&(I.touch1[0]=G);if(E=I.that.__zoom,I.touch1){var T=I.touch0[0],V=I.touch0[1],K=I.touch1[0],J=I.touch1[1],le=(le=K[0]-T[0])*le+(le=K[1]-T[1])*le,fe=(fe=J[0]-V[0])*fe+(fe=J[1]-V[1])*fe;E=A(E,Math.sqrt(le/fe)),G=[(T[0]+K[0])/2,(T[1]+K[1])/2],te=[(V[0]+J[0])/2,(V[1]+J[1])/2]}else if(I.touch0)G=I.touch0[0],te=I.touch0[1];else return;I.zoom("touch",n(S(E,G,te),I.extent,o))}}function q(R,...$){if(this.__zooming){var I=M(this,$).event(R),P=R.changedTouches,Y=P.length,X,E;for(fp(R),m&&clearTimeout(m),m=setTimeout(function(){m=null},b),X=0;X<Y;++X)E=P[X],I.touch0&&I.touch0[2]===E.identifier?delete I.touch0:I.touch1&&I.touch1[2]===E.identifier&&delete I.touch1;if(I.touch1&&!I.touch0&&(I.touch0=I.touch1,delete I.touch1),I.touch0)I.touch0[1]=this.__zoom.invert(I.touch0[0]);else if(I.end(),I.taps===2&&(E=$n(E,this),Math.hypot(g[0]-E[0],g[1]-E[1])<_)){var G=vn(this).on("dblclick.zoom");G&&G.apply(this,arguments)}}}return k.wheelDelta=function(R){return arguments.length?(r=typeof R=="function"?R:Ku(+R),k):r},k.filter=function(R){return arguments.length?(e=typeof R=="function"?R:Ku(!!R),k):e},k.touchable=function(R){return arguments.length?(s=typeof R=="function"?R:Ku(!!R),k):s},k.extent=function(R){return arguments.length?(t=typeof R=="function"?R:Ku([[+R[0][0],+R[0][1]],[+R[1][0],+R[1][1]]]),k):t},k.scaleExtent=function(R){return arguments.length?(l[0]=+R[0],l[1]=+R[1],k):[l[0],l[1]]},k.translateExtent=function(R){return arguments.length?(o[0][0]=+R[0][0],o[1][0]=+R[1][0],o[0][1]=+R[0][1],o[1][1]=+R[1][1],k):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},k.constrain=function(R){return arguments.length?(n=R,k):n},k.duration=function(R){return arguments.length?(c=+R,k):c},k.interpolate=function(R){return arguments.length?(f=R,k):f},k.on=function(){var R=d.on.apply(d,arguments);return R===d?k:R},k.clickDistance=function(R){return arguments.length?(w=(R=+R)*R,k):Math.sqrt(w)},k.tapDistance=function(R){return arguments.length?(_=+R,k):_},k}const or={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},to=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Yk=["Enter"," ","Escape"];var gs;(function(e){e.Strict="strict",e.Loose="loose"})(gs||(gs={}));var na;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(na||(na={}));var no;(function(e){e.Partial="partial",e.Full="full"})(no||(no={}));const Xk={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var bi;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(bi||(bi={}));var Oc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Oc||(Oc={}));var Ne;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ne||(Ne={}));const U1={[Ne.Left]:Ne.Right,[Ne.Right]:Ne.Left,[Ne.Top]:Ne.Bottom,[Ne.Bottom]:Ne.Top};function Qk(e){return e===null?null:e?"valid":"invalid"}const Kk=e=>"id"in e&&"source"in e&&"target"in e,$6=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),jm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ho=(e,t=[0,0])=>{const{width:n,height:r}=Ir(e),s=e.origin??t,l=n*s[0],o=r*s[1];return{x:e.position.x-l,y:e.position.y-o}},V6=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,s)=>{const l=typeof s=="string";let o=!t.nodeLookup&&!l?s:void 0;t.nodeLookup&&(o=l?t.nodeLookup.get(s):jm(s)?s:t.nodeLookup.get(s.id));const c=o?Mc(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ef(r,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return tf(n)},po=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(r=>{if(t.filter===void 0||t.filter(r)){const s=Mc(r);n=ef(n,s)}}),tf(n)},Jk=(e,t,[n,r,s]=[0,0,1],l=!1,o=!1)=>{const c={...go(t,[n,r,s]),width:t.width/s,height:t.height/s},f=[];for(const d of e.values()){const{measured:p,selectable:g=!0,hidden:m=!1}=d;if(o&&!g||m)continue;const b=p.width??d.width??d.initialWidth??null,x=p.height??d.height??d.initialHeight??null,w=ro(c,ys(d)),_=(b??0)*(x??0),k=l&&w>0;(!d.internals.handleBounds||k||w>=_||d.dragging)&&f.push(d)}return f},q6=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function G6(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&n.set(s.id,s)}),n}async function Z6({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:l},o){if(e.size===0)return Promise.resolve(!0);const c=G6(e,o),f=po(c),d=zm(f,t,n,(o==null?void 0:o.minZoom)??s,(o==null?void 0:o.maxZoom)??l,(o==null?void 0:o.padding)??.1);return await r.setViewport(d,{duration:o==null?void 0:o.duration}),Promise.resolve(!0)}function Wk({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:l}){const o=n.get(e),c=o.parentId?n.get(o.parentId):void 0,{x:f,y:d}=c?c.internals.positionAbsolute:{x:0,y:0},p=o.origin??r;let g=s;if(o.extent==="parent"&&!o.expandParent)if(!c)l==null||l("005",or.error005());else{const b=c.measured.width,x=c.measured.height;b&&x&&(g=[[f,d],[f+b,d+x]])}else c&&bs(o.extent)&&(g=[[o.extent[0][0]+f,o.extent[0][1]+d],[o.extent[1][0]+f,o.extent[1][1]+d]]);const m=bs(g)?sa(t,g,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(l==null||l("015",or.error015())),{position:{x:m.x-f+(o.measured.width??0)*p[0],y:m.y-d+(o.measured.height??0)*p[1]},positionAbsolute:m}}async function Y6({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const l=new Set(e.map(m=>m.id)),o=[];for(const m of n){if(m.deletable===!1)continue;const b=l.has(m.id),x=!b&&m.parentId&&o.find(w=>w.id===m.parentId);(b||x)&&o.push(m)}const c=new Set(t.map(m=>m.id)),f=r.filter(m=>m.deletable!==!1),p=q6(o,f);for(const m of f)c.has(m.id)&&!p.find(x=>x.id===m.id)&&p.push(m);if(!s)return{edges:p,nodes:o};const g=await s({nodes:o,edges:p});return typeof g=="boolean"?g?{edges:p,nodes:o}:{edges:[],nodes:[]}:g}const ms=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),sa=(e={x:0,y:0},t,n)=>({x:ms(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:ms(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function eE(e,t,n){const{width:r,height:s}=Ir(n),{x:l,y:o}=n.internals.positionAbsolute;return sa(e,[[l,o],[l+r,o+s]],t)}const H1=(e,t,n)=>e<t?ms(Math.abs(e-t),1,t)/t:e>n?-ms(Math.abs(e-n),1,t)/t:0,tE=(e,t,n=15,r=40)=>{const s=H1(e.x,r,t.width-r)*n,l=H1(e.y,r,t.height-r)*n;return[s,l]},ef=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Qg=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),tf=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),ys=(e,t=[0,0])=>{var s,l;const{x:n,y:r}=jm(e)?e.internals.positionAbsolute:ho(e,t);return{x:n,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0}},Mc=(e,t=[0,0])=>{var s,l;const{x:n,y:r}=jm(e)?e.internals.positionAbsolute:ho(e,t);return{x:n,y:r,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0)}},nE=(e,t)=>tf(ef(Qg(e),Qg(t))),ro=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},$1=e=>qn(e.width)&&qn(e.height)&&qn(e.x)&&qn(e.y),qn=e=>!isNaN(e)&&isFinite(e),X6=(e,t)=>{},nf=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),go=({x:e,y:t},[n,r,s],l=!1,o=[1,1])=>{const c={x:(e-n)/s,y:(t-r)/s};return l?nf(c,o):c},Rc=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function Ka(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Q6(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Ka(e,n),s=Ka(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Ka(e.top??e.y??0,n),s=Ka(e.bottom??e.y??0,n),l=Ka(e.left??e.x??0,t),o=Ka(e.right??e.x??0,t);return{top:r,right:o,bottom:s,left:l,x:l+o,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function K6(e,t,n,r,s,l){const{x:o,y:c}=Rc(e,[t,n,r]),{x:f,y:d}=Rc({x:e.x+e.width,y:e.y+e.height},[t,n,r]),p=s-f,g=l-d;return{left:Math.floor(o),top:Math.floor(c),right:Math.floor(p),bottom:Math.floor(g)}}const zm=(e,t,n,r,s,l)=>{const o=Q6(l,t,n),c=(t-o.x)/e.width,f=(n-o.y)/e.height,d=Math.min(c,f),p=ms(d,r,s),g=e.x+e.width/2,m=e.y+e.height/2,b=t/2-g*p,x=n/2-m*p,w=K6(e,b,x,p,t,n),_={left:Math.min(w.left-o.left,0),top:Math.min(w.top-o.top,0),right:Math.min(w.right-o.right,0),bottom:Math.min(w.bottom-o.bottom,0)};return{x:b-_.left+_.right,y:x-_.top+_.bottom,zoom:p}},Dc=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function bs(e){return e!==void 0&&e!=="parent"}function Ir(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function rE(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function iE(e,t={width:0,height:0},n,r,s){const l={...e},o=r.get(n);if(o){const c=o.origin||s;l.x+=o.internals.positionAbsolute.x-(t.width??0)*c[0],l.y+=o.internals.positionAbsolute.y-(t.height??0)*c[1]}return l}function V1(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function J6(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function Hl(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:l,y:o}=Dr(e),c=go({x:l-((s==null?void 0:s.left)??0),y:o-((s==null?void 0:s.top)??0)},r),{x:f,y:d}=n?nf(c,t):c;return{xSnapped:f,ySnapped:d,...c}}const Lm=e=>({width:e.offsetWidth,height:e.offsetHeight}),aE=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},W6=["INPUT","SELECT","TEXTAREA"];function sE(e){var r,s;const t=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:W6.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const lE=e=>"clientX"in e,Dr=(e,t)=>{var l,o;const n=lE(e),r=n?e.clientX:(l=e.touches)==null?void 0:l[0].clientX,s=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},q1=(e,t,n,r,s)=>{const l=t.querySelectorAll(`.${e}`);return!l||!l.length?null:Array.from(l).map(o=>{const c=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:s,position:o.getAttribute("data-handlepos"),x:(c.left-n.left)/r,y:(c.top-n.top)/r,...Lm(o)}})};function oE({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:l,targetControlX:o,targetControlY:c}){const f=e*.125+s*.375+o*.375+n*.125,d=t*.125+l*.375+c*.375+r*.125,p=Math.abs(f-e),g=Math.abs(d-t);return[f,d,p,g]}function Ju(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function G1({pos:e,x1:t,y1:n,x2:r,y2:s,c:l}){switch(e){case Ne.Left:return[t-Ju(t-r,l),n];case Ne.Right:return[t+Ju(r-t,l),n];case Ne.Top:return[t,n-Ju(n-s,l)];case Ne.Bottom:return[t,n+Ju(s-n,l)]}}function uE({sourceX:e,sourceY:t,sourcePosition:n=Ne.Bottom,targetX:r,targetY:s,targetPosition:l=Ne.Top,curvature:o=.25}){const[c,f]=G1({pos:n,x1:e,y1:t,x2:r,y2:s,c:o}),[d,p]=G1({pos:l,x1:r,y1:s,x2:e,y2:t,c:o}),[g,m,b,x]=oE({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:c,sourceControlY:f,targetControlX:d,targetControlY:p});return[`M${e},${t} C${c},${f} ${d},${p} ${r},${s}`,g,m,b,x]}function cE({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,l=n<e?n+s:n-s,o=Math.abs(r-t)/2,c=r<t?r+o:r-o;return[l,c,s,o]}function e8({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:s=!1}){if(!s)return r;const l=n||t.selected||e.selected,o=Math.max(e.internals.z||0,t.internals.z||0,1e3);return r+(l?o:0)}function t8({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const l=ef(Mc(e),Mc(t));l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const o={x:-s[0]/s[2],y:-s[1]/s[2],width:n/s[2],height:r/s[2]};return ro(o,tf(l))>0}const n8=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,r8=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),i8=(e,t)=>{if(!e.source||!e.target)return t;let n;return Kk(e)?n={...e}:n={...e,id:n8(e)},r8(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function fE({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,l,o,c]=cE({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,l,o,c]}const Z1={[Ne.Left]:{x:-1,y:0},[Ne.Right]:{x:1,y:0},[Ne.Top]:{x:0,y:-1},[Ne.Bottom]:{x:0,y:1}},a8=({source:e,sourcePosition:t=Ne.Bottom,target:n})=>t===Ne.Left||t===Ne.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Y1=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function s8({source:e,sourcePosition:t=Ne.Bottom,target:n,targetPosition:r=Ne.Top,center:s,offset:l}){const o=Z1[t],c=Z1[r],f={x:e.x+o.x*l,y:e.y+o.y*l},d={x:n.x+c.x*l,y:n.y+c.y*l},p=a8({source:f,sourcePosition:t,target:d}),g=p.x!==0?"x":"y",m=p[g];let b=[],x,w;const _={x:0,y:0},k={x:0,y:0},[A,S,O,D]=cE({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[g]*c[g]===-1){x=s.x??A,w=s.y??S;const F=[{x,y:f.y},{x,y:d.y}],L=[{x:f.x,y:w},{x:d.x,y:w}];o[g]===m?b=g==="x"?F:L:b=g==="x"?L:F}else{const F=[{x:f.x,y:d.y}],L=[{x:d.x,y:f.y}];if(g==="x"?b=o.x===m?L:F:b=o.y===m?F:L,t===r){const q=Math.abs(e[g]-n[g]);if(q<=l){const R=Math.min(l-1,l-q);o[g]===m?_[g]=(f[g]>e[g]?-1:1)*R:k[g]=(d[g]>n[g]?-1:1)*R}}if(t!==r){const q=g==="x"?"y":"x",R=o[g]===c[q],$=f[q]>d[q],I=f[q]<d[q];(o[g]===1&&(!R&&$||R&&I)||o[g]!==1&&(!R&&I||R&&$))&&(b=g==="x"?F:L)}const U={x:f.x+_.x,y:f.y+_.y},j={x:d.x+k.x,y:d.y+k.y},H=Math.max(Math.abs(U.x-b[0].x),Math.abs(j.x-b[0].x)),B=Math.max(Math.abs(U.y-b[0].y),Math.abs(j.y-b[0].y));H>=B?(x=(U.x+j.x)/2,w=b[0].y):(x=b[0].x,w=(U.y+j.y)/2)}return[[e,{x:f.x+_.x,y:f.y+_.y},...b,{x:d.x+k.x,y:d.y+k.y},n],x,w,O,D]}function l8(e,t,n,r){const s=Math.min(Y1(e,t)/2,Y1(t,n)/2,r),{x:l,y:o}=t;if(e.x===l&&l===n.x||e.y===o&&o===n.y)return`L${l} ${o}`;if(e.y===o){const d=e.x<n.x?-1:1,p=e.y<n.y?1:-1;return`L ${l+s*d},${o}Q ${l},${o} ${l},${o+s*p}`}const c=e.x<n.x?1:-1,f=e.y<n.y?-1:1;return`L ${l},${o+s*f}Q ${l},${o} ${l+s*c},${o}`}function Kg({sourceX:e,sourceY:t,sourcePosition:n=Ne.Bottom,targetX:r,targetY:s,targetPosition:l=Ne.Top,borderRadius:o=5,centerX:c,centerY:f,offset:d=20}){const[p,g,m,b,x]=s8({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:l,center:{x:c,y:f},offset:d});return[p.reduce((_,k,A)=>{let S="";return A>0&&A<p.length-1?S=l8(p[A-1],k,p[A+1],o):S=`${A===0?"M":"L"}${k.x} ${k.y}`,_+=S,_},""),g,m,b,x]}function X1(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function o8(e){var g;const{sourceNode:t,targetNode:n}=e;if(!X1(t)||!X1(n))return null;const r=t.internals.handleBounds||Q1(t.handles),s=n.internals.handleBounds||Q1(n.handles),l=K1((r==null?void 0:r.source)??[],e.sourceHandle),o=K1(e.connectionMode===gs.Strict?(s==null?void 0:s.target)??[]:((s==null?void 0:s.target)??[]).concat((s==null?void 0:s.source)??[]),e.targetHandle);if(!l||!o)return(g=e.onError)==null||g.call(e,"008",or.error008(l?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(l==null?void 0:l.position)||Ne.Bottom,f=(o==null?void 0:o.position)||Ne.Top,d=io(t,l,c),p=io(n,o,f);return{sourceX:d.x,sourceY:d.y,targetX:p.x,targetY:p.y,sourcePosition:c,targetPosition:f}}function Q1(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function io(e,t,n=Ne.Left,r=!1){const s=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,l=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:c}=t??Ir(e);if(r)return{x:s+o/2,y:l+c/2};switch((t==null?void 0:t.position)??n){case Ne.Top:return{x:s+o/2,y:l};case Ne.Right:return{x:s+o,y:l+c/2};case Ne.Bottom:return{x:s+o/2,y:l+c};case Ne.Left:return{x:s,y:l+c/2}}}function K1(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Jg(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function u8(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const l=new Set;return e.reduce((o,c)=>([c.markerStart||r,c.markerEnd||s].forEach(f=>{if(f&&typeof f=="object"){const d=Jg(f,t);l.has(d)||(o.push({id:d,color:f.color||n,...f}),l.add(d))}}),o),[]).sort((o,c)=>o.id.localeCompare(c.id))}const Im={nodeOrigin:[0,0],nodeExtent:to,elevateNodesOnSelect:!0,defaults:{}},c8={...Im,checkEquality:!0};function Bm(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function f8(e,t,n){const r=Bm(Im,n);for(const s of e.values())if(s.parentId)Fm(s,e,t,r);else{const l=ho(s,r.nodeOrigin),o=bs(s.extent)?s.extent:r.nodeExtent,c=sa(l,o,Ir(s));s.internals.positionAbsolute=c}}function Wg(e,t,n,r){var f,d;const s=Bm(c8,r);let l=e.length>0;const o=new Map(t),c=s!=null&&s.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const p of e){let g=o.get(p.id);if(s.checkEquality&&p===(g==null?void 0:g.internals.userNode))t.set(p.id,g);else{const m=ho(p,s.nodeOrigin),b=bs(p.extent)?p.extent:s.nodeExtent,x=sa(m,b,Ir(p));g={...s.defaults,...p,measured:{width:(f=p.measured)==null?void 0:f.width,height:(d=p.measured)==null?void 0:d.height},internals:{positionAbsolute:x,handleBounds:p.measured?g==null?void 0:g.internals.handleBounds:void 0,z:dE(p,c),userNode:p}},t.set(p.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(l=!1),p.parentId&&Fm(g,t,n,r)}return l}function d8(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Fm(e,t,n,r){const{elevateNodesOnSelect:s,nodeOrigin:l,nodeExtent:o}=Bm(Im,r),c=e.parentId,f=t.get(c);if(!f){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}d8(e,n);const d=s?1e3:0,{x:p,y:g,z:m}=h8(e,f,l,o,d),{positionAbsolute:b}=e.internals,x=p!==b.x||g!==b.y;(x||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:p,y:g}:b,z:m}})}function dE(e,t){return(qn(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function h8(e,t,n,r,s){const{x:l,y:o}=t.internals.positionAbsolute,c=Ir(e),f=ho(e,n),d=bs(e.extent)?sa(f,e.extent,c):f;let p=sa({x:l+d.x,y:o+d.y},r,c);e.extent==="parent"&&(p=eE(p,c,t));const g=dE(e,s),m=t.internals.z??0;return{x:p.x,y:p.y,z:m>g?m:g}}function Pm(e,t,n,r=[0,0]){var o;const s=[],l=new Map;for(const c of e){const f=t.get(c.parentId);if(!f)continue;const d=((o=l.get(c.parentId))==null?void 0:o.expandedRect)??ys(f),p=nE(d,c.rect);l.set(c.parentId,{expandedRect:p,parent:f})}return l.size>0&&l.forEach(({expandedRect:c,parent:f},d)=>{var S;const p=f.internals.positionAbsolute,g=Ir(f),m=f.origin??r,b=c.x<p.x?Math.round(Math.abs(p.x-c.x)):0,x=c.y<p.y?Math.round(Math.abs(p.y-c.y)):0,w=Math.max(g.width,Math.round(c.width)),_=Math.max(g.height,Math.round(c.height)),k=(w-g.width)*m[0],A=(_-g.height)*m[1];(b>0||x>0||k||A)&&(s.push({id:d,type:"position",position:{x:f.position.x-b+k,y:f.position.y-x+A}}),(S=n.get(d))==null||S.forEach(O=>{e.some(D=>D.id===O.id)||s.push({id:O.id,type:"position",position:{x:O.position.x+b,y:O.position.y+x}})})),(g.width<c.width||g.height<c.height||b||x)&&s.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:w+(b?m[0]*b-k:0),height:_+(x?m[1]*x-A:0)}})}),s}function p8(e,t,n,r,s,l){const o=r==null?void 0:r.querySelector(".xyflow__viewport");let c=!1;if(!o)return{changes:[],updatedInternals:c};const f=[],d=window.getComputedStyle(o),{m22:p}=new window.DOMMatrixReadOnly(d.transform),g=[];for(const m of e.values()){const b=t.get(m.id);if(!b)continue;if(b.hidden){t.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),c=!0;continue}const x=Lm(m.nodeElement),w=b.measured.width!==x.width||b.measured.height!==x.height;if(!!(x.width&&x.height&&(w||!b.internals.handleBounds||m.force))){const k=m.nodeElement.getBoundingClientRect(),A=bs(b.extent)?b.extent:l;let{positionAbsolute:S}=b.internals;b.parentId&&b.extent==="parent"?S=eE(S,x,t.get(b.parentId)):A&&(S=sa(S,A,x));const O={...b,measured:x,internals:{...b.internals,positionAbsolute:S,handleBounds:{source:q1("source",m.nodeElement,k,p,b.id),target:q1("target",m.nodeElement,k,p,b.id)}}};t.set(b.id,O),b.parentId&&Fm(O,t,n,{nodeOrigin:s}),c=!0,w&&(f.push({id:b.id,type:"dimensions",dimensions:x}),b.expandParent&&b.parentId&&g.push({id:b.id,parentId:b.parentId,rect:ys(O,s)}))}}if(g.length>0){const m=Pm(g,t,n,s);f.push(...m)}return{changes:f,updatedInternals:c}}async function g8({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:l}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,l]],r),c=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(c)}function J1(e,t,n,r,s,l){let o=s;const c=r.get(o)||new Map;r.set(o,c.set(n,t)),o=`${s}-${e}`;const f=r.get(o)||new Map;if(r.set(o,f.set(n,t)),l){o=`${s}-${e}-${l}`;const d=r.get(o)||new Map;r.set(o,d.set(n,t))}}function hE(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:l,sourceHandle:o=null,targetHandle:c=null}=r,f={edgeId:r.id,source:s,target:l,sourceHandle:o,targetHandle:c},d=`${s}-${o}--${l}-${c}`,p=`${l}-${c}--${s}-${o}`;J1("source",f,p,e,s,o),J1("target",f,d,e,l,c),t.set(r.id,r)}}function pE(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:pE(n,t):!1}function W1(e,t,n){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function m8(e,t,n,r){const s=new Map;for(const[l,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!pE(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const c=e.get(l);c&&s.set(l,{id:l,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return s}function dp({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,c,f;const s=[];for(const[d,p]of t){const g=(o=n.get(d))==null?void 0:o.internals.userNode;g&&s.push({...g,position:p.position,dragging:r})}if(!e)return[s[0],s];const l=(c=n.get(e))==null?void 0:c.internals.userNode;return[l?{...l,position:((f=t.get(e))==null?void 0:f.position)||l.position,dragging:r}:s[0],s]}function y8({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let l={x:null,y:null},o=0,c=new Map,f=!1,d={x:0,y:0},p=null,g=!1,m=null,b=!1;function x({noDragClassName:_,handleSelector:k,domNode:A,isSelectable:S,nodeId:O,nodeClickDistance:D=0}){m=vn(A);function M({x:j,y:H},B){const{nodeLookup:q,nodeExtent:R,snapGrid:$,snapToGrid:I,nodeOrigin:P,onNodeDrag:Y,onSelectionDrag:X,onError:E,updateNodePositions:G}=t();l={x:j,y:H};let te=!1,T={x:0,y:0,x2:0,y2:0};if(c.size>1&&R){const V=po(c);T=Qg(V)}for(const[V,K]of c){if(!q.has(V))continue;let J={x:j-K.distance.x,y:H-K.distance.y};I&&(J=nf(J,$));let le=[[R[0][0],R[0][1]],[R[1][0],R[1][1]]];if(c.size>1&&R&&!K.extent){const{positionAbsolute:Ae}=K.internals,Se=Ae.x-T.x+R[0][0],be=Ae.x+K.measured.width-T.x2+R[1][0],je=Ae.y-T.y+R[0][1],ze=Ae.y+K.measured.height-T.y2+R[1][1];le=[[Se,je],[be,ze]]}const{position:fe,positionAbsolute:ye}=Wk({nodeId:V,nextPosition:J,nodeLookup:q,nodeExtent:le,nodeOrigin:P,onError:E});te=te||K.position.x!==fe.x||K.position.y!==fe.y,K.position=fe,K.internals.positionAbsolute=ye}if(te&&(G(c,!0),B&&(r||Y||!O&&X))){const[V,K]=dp({nodeId:O,dragItems:c,nodeLookup:q});r==null||r(B,c,V,K),Y==null||Y(B,V,K),O||X==null||X(B,K)}}async function F(){if(!p)return;const{transform:j,panBy:H,autoPanSpeed:B,autoPanOnNodeDrag:q}=t();if(!q){f=!1,cancelAnimationFrame(o);return}const[R,$]=tE(d,p,B);(R!==0||$!==0)&&(l.x=(l.x??0)-R/j[2],l.y=(l.y??0)-$/j[2],await H({x:R,y:$})&&M(l,null)),o=requestAnimationFrame(F)}function L(j){var te;const{nodeLookup:H,multiSelectionActive:B,nodesDraggable:q,transform:R,snapGrid:$,snapToGrid:I,selectNodesOnDrag:P,onNodeDragStart:Y,onSelectionDragStart:X,unselectNodesAndEdges:E}=t();g=!0,(!P||!S)&&!B&&O&&((te=H.get(O))!=null&&te.selected||E()),S&&P&&O&&(e==null||e(O));const G=Hl(j.sourceEvent,{transform:R,snapGrid:$,snapToGrid:I,containerBounds:p});if(l=G,c=m8(H,q,G,O),c.size>0&&(n||Y||!O&&X)){const[T,V]=dp({nodeId:O,dragItems:c,nodeLookup:H});n==null||n(j.sourceEvent,c,T,V),Y==null||Y(j.sourceEvent,T,V),O||X==null||X(j.sourceEvent,V)}}const U=Rk().clickDistance(D).on("start",j=>{const{domNode:H,nodeDragThreshold:B,transform:q,snapGrid:R,snapToGrid:$}=t();p=(H==null?void 0:H.getBoundingClientRect())||null,b=!1,B===0&&L(j),l=Hl(j.sourceEvent,{transform:q,snapGrid:R,snapToGrid:$,containerBounds:p}),d=Dr(j.sourceEvent,p)}).on("drag",j=>{const{autoPanOnNodeDrag:H,transform:B,snapGrid:q,snapToGrid:R,nodeDragThreshold:$,nodeLookup:I}=t(),P=Hl(j.sourceEvent,{transform:B,snapGrid:q,snapToGrid:R,containerBounds:p});if((j.sourceEvent.type==="touchmove"&&j.sourceEvent.touches.length>1||O&&!I.has(O))&&(b=!0),!b){if(!f&&H&&g&&(f=!0,F()),!g){const Y=P.xSnapped-(l.x??0),X=P.ySnapped-(l.y??0);Math.sqrt(Y*Y+X*X)>$&&L(j)}(l.x!==P.xSnapped||l.y!==P.ySnapped)&&c&&g&&(d=Dr(j.sourceEvent,p),M(P,j.sourceEvent))}}).on("end",j=>{if(!(!g||b)&&(f=!1,g=!1,cancelAnimationFrame(o),c.size>0)){const{nodeLookup:H,updateNodePositions:B,onNodeDragStop:q,onSelectionDragStop:R}=t();if(B(c,!1),s||q||!O&&R){const[$,I]=dp({nodeId:O,dragItems:c,nodeLookup:H,dragging:!1});s==null||s(j.sourceEvent,c,$,I),q==null||q(j.sourceEvent,$,I),O||R==null||R(j.sourceEvent,I)}}}).filter(j=>{const H=j.target;return!j.button&&(!_||!W1(H,`.${_}`,A))&&(!k||W1(H,k,A))});m.call(U)}function w(){m==null||m.on(".drag",null)}return{update:x,destroy:w}}function b8(e,t,n){const r=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const l of t.values())ro(s,ys(l))>0&&r.push(l);return r}const v8=250;function x8(e,t,n,r){var c,f;let s=[],l=1/0;const o=b8(e,n,t+v8);for(const d of o){const p=[...((c=d.internals.handleBounds)==null?void 0:c.source)??[],...((f=d.internals.handleBounds)==null?void 0:f.target)??[]];for(const g of p){if(r.nodeId===g.nodeId&&r.type===g.type&&r.id===g.id)continue;const{x:m,y:b}=io(d,g,g.position,!0),x=Math.sqrt(Math.pow(m-e.x,2)+Math.pow(b-e.y,2));x>t||(x<l?(s=[{...g,x:m,y:b}],l=x):x===l&&s.push({...g,x:m,y:b}))}}if(!s.length)return null;if(s.length>1){const d=r.type==="source"?"target":"source";return s.find(p=>p.type===d)??s[0]}return s[0]}function gE(e,t,n,r,s,l=!1){var d,p,g;const o=r.get(e);if(!o)return null;const c=s==="strict"?(d=o.internals.handleBounds)==null?void 0:d[t]:[...((p=o.internals.handleBounds)==null?void 0:p.source)??[],...((g=o.internals.handleBounds)==null?void 0:g.target)??[]],f=(n?c==null?void 0:c.find(m=>m.id===n):c==null?void 0:c[0])??null;return f&&l?{...f,...io(o,f,f.position,!0)}:f}function mE(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function w8(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const yE=()=>!0;function _8(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:l,isTarget:o,domNode:c,nodeLookup:f,lib:d,autoPanOnConnect:p,flowId:g,panBy:m,cancelConnection:b,onConnectStart:x,onConnect:w,onConnectEnd:_,isValidConnection:k=yE,onReconnectEnd:A,updateConnection:S,getTransform:O,getFromHandle:D,autoPanSpeed:M}){const F=aE(e.target);let L=0,U;const{x:j,y:H}=Dr(e),B=F==null?void 0:F.elementFromPoint(j,H),q=mE(l,B),R=c==null?void 0:c.getBoundingClientRect();if(!R||!q)return;const $=gE(s,q,r,f,t);if(!$)return;let I=Dr(e,R),P=!1,Y=null,X=!1,E=null;function G(){if(!p||!R)return;const[ye,Ae]=tE(I,R,M);m({x:ye,y:Ae}),L=requestAnimationFrame(G)}const te={...$,nodeId:s,type:q,position:$.position},T=f.get(s),K={inProgress:!0,isValid:null,from:io(T,te,Ne.Left,!0),fromHandle:te,fromPosition:te.position,fromNode:T,to:I,toHandle:null,toPosition:U1[te.position],toNode:null};S(K);let J=K;x==null||x(e,{nodeId:s,handleId:r,handleType:q});function le(ye){if(!D()||!te){fe(ye);return}const Ae=O();I=Dr(ye,R),U=x8(go(I,Ae,!1,[1,1]),n,f,te),P||(G(),P=!0);const Se=bE(ye,{handle:U,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:o?"target":"source",isValidConnection:k,doc:F,lib:d,flowId:g,nodeLookup:f});E=Se.handleDomNode,Y=Se.connection,X=w8(!!U,Se.isValid);const be={...J,isValid:X,to:Se.toHandle&&X?Rc({x:Se.toHandle.x,y:Se.toHandle.y},Ae):I,toHandle:Se.toHandle,toPosition:X&&Se.toHandle?Se.toHandle.position:U1[te.position],toNode:Se.toHandle?f.get(Se.toHandle.nodeId):null};X&&U&&J.toHandle&&be.toHandle&&J.toHandle.type===be.toHandle.type&&J.toHandle.nodeId===be.toHandle.nodeId&&J.toHandle.id===be.toHandle.id&&J.to.x===be.to.x&&J.to.y===be.to.y||(S(be),J=be)}function fe(ye){(U||E)&&Y&&X&&(w==null||w(Y));const{inProgress:Ae,...Se}=J,be={...Se,toPosition:J.toHandle?J.toPosition:null};_==null||_(ye,be),l&&(A==null||A(ye,be)),b(),cancelAnimationFrame(L),P=!1,X=!1,Y=null,E=null,F.removeEventListener("mousemove",le),F.removeEventListener("mouseup",fe),F.removeEventListener("touchmove",le),F.removeEventListener("touchend",fe)}F.addEventListener("mousemove",le),F.addEventListener("mouseup",fe),F.addEventListener("touchmove",le),F.addEventListener("touchend",fe)}function bE(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:l,doc:o,lib:c,flowId:f,isValidConnection:d=yE,nodeLookup:p}){const g=l==="target",m=t?o.querySelector(`.${c}-flow__handle[data-id="${f}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:b,y:x}=Dr(e),w=o.elementFromPoint(b,x),_=w!=null&&w.classList.contains(`${c}-flow__handle`)?w:m,k={handleDomNode:_,isValid:!1,connection:null,toHandle:null};if(_){const A=mE(void 0,_),S=_.getAttribute("data-nodeid"),O=_.getAttribute("data-handleid"),D=_.classList.contains("connectable"),M=_.classList.contains("connectableend");if(!S||!A)return k;const F={source:g?S:r,sourceHandle:g?O:s,target:g?r:S,targetHandle:g?s:O};k.connection=F;const U=D&&M&&(n===gs.Strict?g&&A==="source"||!g&&A==="target":S!==r||O!==s);k.isValid=U&&d(F),k.toHandle=gE(S,A,O,p,n,!0)}return k}const em={onPointerDown:_8,isValid:bE};function S8({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=vn(e);function l({translateExtent:c,width:f,height:d,zoomStep:p=10,pannable:g=!0,zoomable:m=!0,inversePan:b=!1}){const x=S=>{const O=n();if(S.sourceEvent.type!=="wheel"||!t)return;const D=-S.sourceEvent.deltaY*(S.sourceEvent.deltaMode===1?.05:S.sourceEvent.deltaMode?1:.002)*p,M=O[2]*Math.pow(2,D);t.scaleTo(M)};let w=[0,0];const _=S=>{(S.sourceEvent.type==="mousedown"||S.sourceEvent.type==="touchstart")&&(w=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY])},k=S=>{const O=n();if(S.sourceEvent.type!=="mousemove"&&S.sourceEvent.type!=="touchmove"||!t)return;const D=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY],M=[D[0]-w[0],D[1]-w[1]];w=D;const F=r()*Math.max(O[2],Math.log(O[2]))*(b?-1:1),L={x:O[0]-M[0]*F,y:O[1]-M[1]*F},U=[[0,0],[f,d]];t.setViewportConstrained({x:L.x,y:L.y,zoom:O[2]},U,c)},A=Zk().on("start",_).on("zoom",g?k:null).on("zoom.wheel",m?x:null);s.call(A,{})}function o(){s.on("zoom",null)}return{update:l,destroy:o,pointer:$n}}const k8=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,rf=e=>({x:e.x,y:e.y,zoom:e.k}),hp=({x:e,y:t,zoom:n})=>Wc.translate(e,t).scale(n),ts=(e,t)=>e.target.closest(`.${t}`),vE=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),pp=(e,t=0,n=()=>{})=>{const r=typeof t=="number"&&t>0;return r||n(),r?e.transition().duration(t).on("end",n):e},xE=e=>{const t=e.ctrlKey&&Dc()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function E8({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:l,zoomOnPinch:o,onPanZoomStart:c,onPanZoom:f,onPanZoomEnd:d}){return p=>{if(ts(p,t))return!1;p.preventDefault(),p.stopImmediatePropagation();const g=n.property("__zoom").k||1;if(p.ctrlKey&&o){const _=$n(p),k=xE(p),A=g*Math.pow(2,k);r.scaleTo(n,A,_,p);return}const m=p.deltaMode===1?20:1;let b=s===na.Vertical?0:p.deltaX*m,x=s===na.Horizontal?0:p.deltaY*m;!Dc()&&p.shiftKey&&s!==na.Vertical&&(b=p.deltaY*m,x=0),r.translateBy(n,-(b/g)*l,-(x/g)*l,{internal:!0});const w=rf(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,c==null||c(p,w)),e.isPanScrolling&&(f==null||f(p,w),e.panScrollTimeout=setTimeout(()=>{d==null||d(p,w),e.isPanScrolling=!1},150))}}function A8({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const l=r.type==="wheel",o=!t&&l&&!r.ctrlKey,c=ts(r,e);if(r.ctrlKey&&l&&c&&r.preventDefault(),o||c)return null;r.preventDefault(),n.call(this,r,s)}}function T8({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var l,o,c;if((l=r.sourceEvent)!=null&&l.internal)return;const s=rf(r.transform);e.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((c=r.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function C8({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return l=>{var o,c;e.usedRightMouseButton=!!(n&&vE(t,e.mouseButton??0)),(o=l.sourceEvent)!=null&&o.sync||r([l.transform.x,l.transform.y,l.transform.k]),s&&!((c=l.sourceEvent)!=null&&c.internal)&&(s==null||s(l.sourceEvent,rf(l.transform)))}}function N8({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:l}){return o=>{var c;if(!((c=o.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,l&&vE(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&l(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),s&&k8(e.prevViewport,o.transform))){const f=rf(o.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(o.sourceEvent,f)},n?150:0)}}}function O8({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:l,userSelectionActive:o,noWheelClassName:c,noPanClassName:f,lib:d}){return p=>{var x;const g=e||t,m=n&&p.ctrlKey;if(p.button===1&&p.type==="mousedown"&&(ts(p,`${d}-flow__node`)||ts(p,`${d}-flow__edge`)))return!0;if(!r&&!g&&!s&&!l&&!n||o||ts(p,c)&&p.type==="wheel"||ts(p,f)&&(p.type!=="wheel"||s&&p.type==="wheel"&&!e)||!n&&p.ctrlKey&&p.type==="wheel")return!1;if(!n&&p.type==="touchstart"&&((x=p.touches)==null?void 0:x.length)>1)return p.preventDefault(),!1;if(!g&&!s&&!m&&p.type==="wheel"||!r&&(p.type==="mousedown"||p.type==="touchstart")||Array.isArray(r)&&!r.includes(p.button)&&p.type==="mousedown")return!1;const b=Array.isArray(r)&&r.includes(p.button)||!p.button||p.button<=1;return(!p.ctrlKey||p.type==="wheel")&&b}}function M8({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:s,viewport:l,onPanZoom:o,onPanZoomStart:c,onPanZoomEnd:f,onDraggingChange:d}){const p={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=e.getBoundingClientRect(),m=Zk().clickDistance(!qn(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(s),b=vn(e).call(m);S({x:l.x,y:l.y,zoom:ms(l.zoom,t,n)},[[0,0],[g.width,g.height]],s);const x=b.on("wheel.zoom"),w=b.on("dblclick.zoom");m.wheelDelta(xE);function _(B,q){return b?new Promise(R=>{m==null||m.transform(pp(b,q==null?void 0:q.duration,()=>R(!0)),B)}):Promise.resolve(!1)}function k({noWheelClassName:B,noPanClassName:q,onPaneContextMenu:R,userSelectionActive:$,panOnScroll:I,panOnDrag:P,panOnScrollMode:Y,panOnScrollSpeed:X,preventScrolling:E,zoomOnPinch:G,zoomOnScroll:te,zoomOnDoubleClick:T,zoomActivationKeyPressed:V,lib:K,onTransformChange:J}){$&&!p.isZoomingOrPanning&&A();const fe=I&&!V&&!$?E8({zoomPanValues:p,noWheelClassName:B,d3Selection:b,d3Zoom:m,panOnScrollMode:Y,panOnScrollSpeed:X,zoomOnPinch:G,onPanZoomStart:c,onPanZoom:o,onPanZoomEnd:f}):A8({noWheelClassName:B,preventScrolling:E,d3ZoomHandler:x});if(b.on("wheel.zoom",fe,{passive:!1}),!$){const Ae=T8({zoomPanValues:p,onDraggingChange:d,onPanZoomStart:c});m.on("start",Ae);const Se=C8({zoomPanValues:p,panOnDrag:P,onPaneContextMenu:!!R,onPanZoom:o,onTransformChange:J});m.on("zoom",Se);const be=N8({zoomPanValues:p,panOnDrag:P,panOnScroll:I,onPaneContextMenu:R,onPanZoomEnd:f,onDraggingChange:d});m.on("end",be)}const ye=O8({zoomActivationKeyPressed:V,panOnDrag:P,zoomOnScroll:te,panOnScroll:I,zoomOnDoubleClick:T,zoomOnPinch:G,userSelectionActive:$,noPanClassName:q,noWheelClassName:B,lib:K});m.filter(ye),T?b.on("dblclick.zoom",w):b.on("dblclick.zoom",null)}function A(){m.on("zoom",null)}async function S(B,q,R){const $=hp(B),I=m==null?void 0:m.constrain()($,q,R);return I&&await _(I),new Promise(P=>P(I))}async function O(B,q){const R=hp(B);return await _(R,q),new Promise($=>$(R))}function D(B){if(b){const q=hp(B),R=b.property("__zoom");(R.k!==B.zoom||R.x!==B.x||R.y!==B.y)&&(m==null||m.transform(b,q,null,{sync:!0}))}}function M(){const B=b?Gk(b.node()):{x:0,y:0,k:1};return{x:B.x,y:B.y,zoom:B.k}}function F(B,q){return b?new Promise(R=>{m==null||m.scaleTo(pp(b,q==null?void 0:q.duration,()=>R(!0)),B)}):Promise.resolve(!1)}function L(B,q){return b?new Promise(R=>{m==null||m.scaleBy(pp(b,q==null?void 0:q.duration,()=>R(!0)),B)}):Promise.resolve(!1)}function U(B){m==null||m.scaleExtent(B)}function j(B){m==null||m.translateExtent(B)}function H(B){const q=!qn(B)||B<0?0:B;m==null||m.clickDistance(q)}return{update:k,destroy:A,setViewport:O,setViewportConstrained:S,getViewport:M,scaleTo:F,scaleBy:L,setScaleExtent:U,setTranslateExtent:j,syncViewport:D,setClickDistance:H}}var $l;(function(e){e.Line="line",e.Handle="handle"})($l||($l={}));function R8({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:l}){const o=e-t,c=n-r,f=[o>0?1:o<0?-1:0,c>0?1:c<0?-1:0];return o&&s&&(f[0]=f[0]*-1),c&&l&&(f[1]=f[1]*-1),f}function D8(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:s}}function pi(e,t){return Math.max(0,t-e)}function gi(e,t){return Math.max(0,e-t)}function Wu(e,t,n){return Math.max(0,t-e,e-n)}function ew(e,t){return e?!t:t}function j8(e,t,n,r,s,l,o,c){let{affectsX:f,affectsY:d}=t;const{isHorizontal:p,isVertical:g}=t,m=p&&g,{xSnapped:b,ySnapped:x}=n,{minWidth:w,maxWidth:_,minHeight:k,maxHeight:A}=r,{x:S,y:O,width:D,height:M,aspectRatio:F}=e;let L=Math.floor(p?b-e.pointerX:0),U=Math.floor(g?x-e.pointerY:0);const j=D+(f?-L:L),H=M+(d?-U:U),B=-l[0]*D,q=-l[1]*M;let R=Wu(j,w,_),$=Wu(H,k,A);if(o){let Y=0,X=0;f&&L<0?Y=pi(S+L+B,o[0][0]):!f&&L>0&&(Y=gi(S+j+B,o[1][0])),d&&U<0?X=pi(O+U+q,o[0][1]):!d&&U>0&&(X=gi(O+H+q,o[1][1])),R=Math.max(R,Y),$=Math.max($,X)}if(c){let Y=0,X=0;f&&L>0?Y=gi(S+L,c[0][0]):!f&&L<0&&(Y=pi(S+j,c[1][0])),d&&U>0?X=gi(O+U,c[0][1]):!d&&U<0&&(X=pi(O+H,c[1][1])),R=Math.max(R,Y),$=Math.max($,X)}if(s){if(p){const Y=Wu(j/F,k,A)*F;if(R=Math.max(R,Y),o){let X=0;!f&&!d||f&&!d&&m?X=gi(O+q+j/F,o[1][1])*F:X=pi(O+q+(f?L:-L)/F,o[0][1])*F,R=Math.max(R,X)}if(c){let X=0;!f&&!d||f&&!d&&m?X=pi(O+j/F,c[1][1])*F:X=gi(O+(f?L:-L)/F,c[0][1])*F,R=Math.max(R,X)}}if(g){const Y=Wu(H*F,w,_)/F;if($=Math.max($,Y),o){let X=0;!f&&!d||d&&!f&&m?X=gi(S+H*F+B,o[1][0])/F:X=pi(S+(d?U:-U)*F+B,o[0][0])/F,$=Math.max($,X)}if(c){let X=0;!f&&!d||d&&!f&&m?X=pi(S+H*F,c[1][0])/F:X=gi(S+(d?U:-U)*F,c[0][0])/F,$=Math.max($,X)}}}U=U+(U<0?$:-$),L=L+(L<0?R:-R),s&&(m?j>H*F?U=(ew(f,d)?-L:L)/F:L=(ew(f,d)?-U:U)*F:p?(U=L/F,d=f):(L=U*F,f=d));const I=f?S+L:S,P=d?O+U:O;return{width:D+(f?-L:L),height:M+(d?-U:U),x:l[0]*L*(f?-1:1)+I,y:l[1]*U*(d?-1:1)+P}}const wE={width:0,height:0,x:0,y:0},z8={...wE,pointerX:0,pointerY:0,aspectRatio:1};function L8(e){return[[0,0],[e.measured.width,e.measured.height]]}function I8(e,t,n){const r=t.position.x+e.position.x,s=t.position.y+e.position.y,l=e.measured.width??0,o=e.measured.height??0,c=n[0]*l,f=n[1]*o;return[[r-c,s-f],[r+l-c,s+o-f]]}function B8({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const l=vn(e);function o({controlPosition:f,boundaries:d,keepAspectRatio:p,resizeDirection:g,onResizeStart:m,onResize:b,onResizeEnd:x,shouldResize:w}){let _={...wE},k={...z8};const A=D8(f);let S,O=null,D=[],M,F,L;const U=Rk().on("start",j=>{const{nodeLookup:H,transform:B,snapGrid:q,snapToGrid:R,nodeOrigin:$,paneDomNode:I}=n();if(S=H.get(t),!S)return;O=(I==null?void 0:I.getBoundingClientRect())??null;const{xSnapped:P,ySnapped:Y}=Hl(j.sourceEvent,{transform:B,snapGrid:q,snapToGrid:R,containerBounds:O});_={width:S.measured.width??0,height:S.measured.height??0,x:S.position.x??0,y:S.position.y??0},k={..._,pointerX:P,pointerY:Y,aspectRatio:_.width/_.height},M=void 0,S.parentId&&(S.extent==="parent"||S.expandParent)&&(M=H.get(S.parentId),F=M&&S.extent==="parent"?L8(M):void 0),D=[],L=void 0;for(const[X,E]of H)if(E.parentId===t&&(D.push({id:X,position:{...E.position},extent:E.extent}),E.extent==="parent"||E.expandParent)){const G=I8(E,S,E.origin??$);L?L=[[Math.min(G[0][0],L[0][0]),Math.min(G[0][1],L[0][1])],[Math.max(G[1][0],L[1][0]),Math.max(G[1][1],L[1][1])]]:L=G}m==null||m(j,{..._})}).on("drag",j=>{const{transform:H,snapGrid:B,snapToGrid:q,nodeOrigin:R}=n(),$=Hl(j.sourceEvent,{transform:H,snapGrid:B,snapToGrid:q,containerBounds:O}),I=[];if(!S)return;const{x:P,y:Y,width:X,height:E}=_,G={},te=S.origin??R,{width:T,height:V,x:K,y:J}=j8(k,A,$,d,p,te,F,L),le=T!==X,fe=V!==E,ye=K!==P&&le,Ae=J!==Y&&fe;if(!ye&&!Ae&&!le&&!fe)return;if((ye||Ae||te[0]===1||te[1]===1)&&(G.x=ye?K:_.x,G.y=Ae?J:_.y,_.x=G.x,_.y=G.y,D.length>0)){const ze=K-P,lt=J-Y;for(const ft of D)ft.position={x:ft.position.x-ze+te[0]*(T-X),y:ft.position.y-lt+te[1]*(V-E)},I.push(ft)}if((le||fe)&&(G.width=le&&(!g||g==="horizontal")?T:_.width,G.height=fe&&(!g||g==="vertical")?V:_.height,_.width=G.width,_.height=G.height),M&&S.expandParent){const ze=te[0]*(G.width??0);G.x&&G.x<ze&&(_.x=ze,k.x=k.x-(G.x-ze));const lt=te[1]*(G.height??0);G.y&&G.y<lt&&(_.y=lt,k.y=k.y-(G.y-lt))}const Se=R8({width:_.width,prevWidth:X,height:_.height,prevHeight:E,affectsX:A.affectsX,affectsY:A.affectsY}),be={..._,direction:Se};(w==null?void 0:w(j,be))!==!1&&(b==null||b(j,be),r(G,I))}).on("end",j=>{x==null||x(j,{..._}),s==null||s({..._})});l.call(U)}function c(){l.on(".drag",null)}return{update:o,destroy:c}}var gp={exports:{}},mp={},yp={exports:{}},bp={};/**
|
|
222
|
+
*/const x1=["border-red-400","border-blue-400","border-green-500","border-yellow-400","border-purple-400","border-pink-400","border-indigo-400"],rL=e=>{let t=0;for(let r=0;r<e.length;r++)t=e.charCodeAt(r)+((t<<5)-t);const n=Math.abs(t%x1.length);return x1[n]},iL=({message:e,client:t,getMessageContent:n,formatTokens:r,isCollapsed:s,onToggleCollapse:l})=>{const{getToolUIRender:o}=oa(),c=o(e.name),f=rL(e.name);return N.jsxs("div",{className:"flex flex-col w-full",children:[c?c(e):N.jsxs("div",{className:`flex flex-col w-full bg-white rounded-lg shadow-sm border-2 ${f} overflow-hidden`,children:[N.jsx("div",{className:"flex items-center justify-between p-3 cursor-pointer hover:bg-gray-100 transition-colors",onClick:l,children:N.jsxs("div",{className:"text-sm font-medium text-gray-700",onClick:()=>console.log(e),children:[e.node_name," | ",e.name]})}),!s&&N.jsxs("div",{className:"flex flex-col gap-4 p-4 border-t border-gray-100",children:[N.jsx(w1,{content:e.tool_input||""}),N.jsx(w1,{content:n(e.content)}),N.jsx(rm,{response_metadata:e.response_metadata,usage_metadata:e.usage_metadata||{},spend_time:e.spend_time,id:e.id,tool_call_id:e.tool_call_id})]})]}),e.sub_agent_messages&&N.jsx("div",{className:"flex flex-col pl-4 py-2 border-l border-gray-300",children:N.jsx(Nm,{renderMessages:e.sub_agent_messages,collapsedTools:[],toggleToolCollapse:d=>{},client:t})})]})},w1=({content:e})=>{const t=()=>{try{return JSON.parse(e),!0}catch{return!1}},n=e.startsWith("{")&&e.endsWith("}")&&t(),r=e.includes("#")||e.includes("```")||e.includes("*"),[s,l]=W.useState(n),[o,c]=W.useState(!1),f=()=>{navigator.clipboard.writeText(e)};return N.jsxs("div",{className:"flex flex-col",children:[N.jsxs("div",{className:"flex gap-2 mb-2",children:[N.jsx("button",{onClick:f,className:"px-2 py-1 text-xs font-medium text-gray-600 bg-green-100 rounded hover:bg-green-200 transition-colors",children:"copy"}),n&&N.jsx("button",{onClick:()=>l(!s),className:"px-2 py-1 text-xs font-medium text-gray-600 bg-orange-100 rounded hover:bg-orange-200 transition-colors",children:"json"}),r&&N.jsx("button",{onClick:()=>c(!o),className:"px-2 py-1 text-xs font-medium text-gray-600 bg-blue-100 rounded hover:bg-blue-200 transition-colors",children:"markdown"})]}),N.jsx("div",{className:"flex flex-col max-h-[300px] overflow-auto border border-gray-200 rounded p-2 w-full text-xs font-mono whitespace-pre-wrap",children:s&&n?N.jsx(nL,{code:JSON.stringify(JSON.parse(e),null,2),language:"json",theme:pk.oneLight,children:({className:d,style:p,tokens:g,getLineProps:m,getTokenProps:b})=>N.jsx("pre",{style:p,children:g.map((x,w)=>N.jsx("div",{...m({line:x}),children:x.map((_,k)=>N.jsx("span",{...b({token:_})},k))},w))})}):o&&r?N.jsx("div",{className:"markdown-body",children:N.jsx(SS,{remarkPlugins:[ZS],children:e})}):N.jsx("pre",{className:"whitespace-pre-wrap",children:e})})]})},Nm=({renderMessages:e,collapsedTools:t,toggleToolCollapse:n,client:r})=>N.jsx("div",{className:"flex flex-col gap-4 w-full",children:e.map((s,l)=>N.jsx("div",{children:s.type==="human"?N.jsx(jT,{content:s.content}):s.type==="tool"?N.jsx(iL,{message:s,client:r,getMessageContent:am,formatTokens:FC,isCollapsed:t.includes(s.id),onToggleCollapse:()=>n(s.id)}):N.jsx(M3,{message:s})},s.unique_id))}),aL=({onClose:e,formatTime:t})=>{const{historyList:n,currentChatId:r,refreshHistoryList:s,createNewChat:l,deleteHistoryChat:o,toHistoryChat:c}=oa();return N.jsxs("div",{className:" bg-white rounded-lg shadow-md h-full flex flex-col border-r",children:[N.jsxs("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center h-16",children:[N.jsxs("div",{className:"flex items-center gap-3",children:[N.jsx("h3",{className:"m-0 text-lg text-gray-800",children:"历史记录"}),N.jsx("button",{className:"p-1.5 text-base rounded bg-blue-100 hover:bg-blue-200 transition-all duration-200 flex items-center justify-center hover:scale-110 group",onClick:s,title:"刷新列表",children:N.jsx(lz,{className:"w-4 h-4 text-blue-600 group-hover:text-blue-700 group-hover:rotate-180 transition-all duration-300"})})]}),N.jsx("button",{className:"p-1.5 text-base rounded bg-red-100 hover:bg-red-200 transition-all duration-200 flex items-center justify-center hover:scale-110 group",onClick:e,title:"关闭",children:N.jsx(QS,{className:"w-4 h-4 text-red-600 group-hover:text-red-700"})})]}),N.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[N.jsx("div",{className:"flex flex-col gap-3 cursor-pointer",onClick:()=>{l()},children:N.jsx("div",{className:"flex justify-between items-center p-3 rounded-lg bg-gray-50 hover:bg-gray-100 transition-colors duration-200",children:N.jsx("div",{className:"text-sm text-gray-800 truncate",children:"New Chat"})})}),n.length===0?N.jsx("div",{className:"text-center text-gray-500 py-8",children:"暂无历史记录"}):N.jsx("div",{className:"flex flex-col gap-3 mt-3",children:n.sort((f,d)=>new Date(d.created_at).getTime()-new Date(f.created_at).getTime()).map(f=>N.jsxs("div",{className:`flex justify-between items-center p-3 rounded-lg transition-colors duration-200 ${f.thread_id===r?"bg-blue-50 border border-blue-200":"bg-gray-50 hover:bg-gray-100"}`,children:[N.jsxs("div",{className:"flex-1 min-w-0 mr-2",children:[N.jsx("div",{className:"text-sm text-gray-800 mb-1 truncate max-w-[180px]",children:PC(f)}),N.jsxs("div",{className:"flex gap-3 text-xs text-gray-500",children:[N.jsx("span",{className:"truncate max-w-[100px]",children:t(new Date(f.created_at))}),N.jsx("span",{className:"truncate max-w-[60px]",children:f.status})]})]}),N.jsxs("div",{className:"flex gap-2 shrink-0",children:[N.jsx("button",{className:"p-1.5 text-base rounded bg-green-100 hover:bg-green-200 transition-all duration-200 flex items-center justify-center hover:scale-110 group",onClick:()=>{c(f)},title:"恢复对话",children:N.jsx(uz,{className:"w-4 h-4 text-green-600 group-hover:text-green-700 group-hover:-rotate-180 transition-all duration-300"})}),N.jsx("button",{className:"p-1.5 text-base rounded bg-red-100 hover:bg-red-200 transition-all duration-200 flex items-center justify-center hover:scale-110 group",onClick:async()=>{await o(f)},title:"删除对话",children:N.jsx(hz,{className:"w-4 h-4 text-red-600 group-hover:text-red-700"})})]})]},f.thread_id))})]})]})},mk=W.createContext(void 0),sL=({children:e})=>{const[t,n]=W.useState(()=>{const s=localStorage.getItem("extraParams");try{return s?JSON.parse(s):{}}catch(l){return console.error("Failed to parse extraParams from localStorage",l),{}}});W.useEffect(()=>{localStorage.setItem("extraParams",JSON.stringify(t))},[t]);const r=s=>{n(s)};return N.jsx(mk.Provider,{value:{extraParams:t,setExtraParams:r},children:e})},yk=()=>{const e=W.useContext(mk);if(e===void 0)throw new Error("useExtraParams must be used within an ExtraParamsProvider");return e};class lL{constructor(t={}){ut(this,"apiUrl");this.apiUrl=t.apiUrl||""}createFormData(t,n){const r=new FormData;if(typeof t=="string"){const s=new Blob([t],{type:"text/plain"});r.append("file",s,n||"file.txt")}else r.append("file",t,n||(t instanceof File?t.name:"file"));return r}async upload(t,n={}){const s={method:"POST",body:this.createFormData(t,n.filename)};n.signal&&(s.signal=n.signal);try{const l=await fetch(`${this.apiUrl}${this.getUploadEndpoint()}`,s);if(!l.ok)throw new Error(`Upload failed with status: ${l.status}`);const o=await l.json();return this.processResponse(o)}catch(l){throw new Error(`File upload failed: ${l instanceof Error?l.message:String(l)}`)}}}class oL extends lL{constructor(t={}){super({apiUrl:t.apiUrl||"https://tmpfiles.org/api/v1"})}getUploadEndpoint(){return"/upload"}processResponse(t){var n;return(n=t.data)!=null&&n.url&&(t.data.url=t.data.url.replace("//tmpfiles.org/","//tmpfiles.org/dl/")),t}}const uL=({onFileUploaded:e})=>{const[t,n]=W.useState([]),r=new oL,s=3,l=W.useCallback(async c=>{var p;const d=Array.from(c.target.files||[]).filter(g=>g.type.startsWith("image/"));if(t.length+d.length>s){alert(`最多只能上传${s}张图片`),c.target.value="";return}n(g=>[...g,...d]);for(const g of d)try{const m=await r.upload(g);(p=m.data)!=null&&p.url&&e(m.data.url)}catch(m){console.error("Upload failed:",m)}c.target.value=""},[e,t.length]),o=W.useCallback(c=>{n(f=>f.filter((d,p)=>p!==c))},[]);return N.jsxs("div",{className:"flex gap-2 rounded-lg flex-1",children:[t.length<s&&N.jsxs("label",{className:`inline-flex items-center justify-center w-20 h-20 text-gray-500 bg-gray-100 rounded-lg cursor-pointer transition-all duration-200 hover:bg-gray-200 ${t.length===0?"w-8 h-8":""}`,children:[N.jsxs("svg",{viewBox:"0 0 24 24",width:t.length===0?"20":"32",height:t.length===0?"20":"32",fill:"currentColor",children:[N.jsx("path",{d:"M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z"}),N.jsx("path",{d:"M20 4h-3.17l-1.24-1.35A1.99 1.99 0 0 0 14.12 2H9.88c-.56 0-1.1.24-1.48.65L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 13c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"})]}),N.jsx("input",{type:"file",accept:"image/*",multiple:!0,onChange:l,className:"hidden"})]}),N.jsx("div",{className:"flex flex-wrap gap-2",children:t.map((c,f)=>N.jsxs("div",{className:"relative w-20 h-20 rounded-lg overflow-hidden",children:[N.jsx("img",{src:URL.createObjectURL(c),alt:c.name,className:"w-full h-full object-cover border border-gray-200"}),N.jsx("button",{className:"absolute top-0.5 right-0.5 w-5 h-5 bg-black/50 text-white rounded-full flex items-center justify-center text-base leading-none hover:bg-black/70 transition-colors",onClick:()=>o(f),children:"×"})]},f))})]})},_1="json-editor-presets",S1="json-editor-active-tab",cL=({isOpen:e,initialJson:t,onClose:n,onSave:r})=>{const[s,l]=W.useState([]),[o,c]=W.useState(0),[f,d]=W.useState(""),[p,g]=W.useState(null),[m,b]=W.useState(null),[x,w]=W.useState("");if(W.useEffect(()=>{if(e){let D=[];try{const F=localStorage.getItem(_1);D=F?JSON.parse(F):[]}catch(F){console.error("Failed to parse presets from localStorage",F),D=[]}D.length===0&&(D=[{name:"Default",data:t}]),l(D);let M=0;try{const F=localStorage.getItem(S1);if(F){const L=parseInt(F,10);L>=0&&L<D.length&&(M=L)}}catch(F){console.error("Failed to parse active tab from localStorage",F)}c(M),g(null)}},[e,t]),W.useEffect(()=>{e&&s.length>0&&s[o]&&(d(JSON.stringify(s[o].data,null,2)),g(null))},[o,s,e]),W.useEffect(()=>{e&&localStorage.setItem(S1,o.toString())},[o,e]),!e)return null;const _=D=>{l(D),localStorage.setItem(_1,JSON.stringify(D))},k=()=>{const D={name:`Preset ${s.length+1}`,data:{}},M=[...s,D];_(M),c(M.length-1)},A=D=>{let M=s.filter((F,L)=>L!==D);M.length===0&&(M=[{name:"Default",data:t}]),_(M),o>=D&&o>0?c(o-1):o>=M.length&&c(M.length-1)},S=()=>{try{const D=JSON.parse(f),M=s.map((F,L)=>L===o?{...F,data:D}:F);_(M),r(D),n()}catch(D){g("JSON 格式无效,请检查后重试。"),console.error("Invalid JSON format:",D)}},O=D=>{if(x.trim()!==""){const M=s.map((F,L)=>L===D?{...F,name:x.trim()}:F);_(M),b(null)}};return N.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:N.jsxs("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-2xl mx-4 flex flex-col",style:{height:"80vh"},children:[N.jsx("div",{className:"p-6 border-b border-gray-200",children:N.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"编辑 Extra Parameters"})}),N.jsxs("div",{className:"flex-grow p-6 overflow-y-auto",children:[N.jsxs("div",{className:"flex items-center border-b border-gray-200 mb-4",children:[s.map((D,M)=>N.jsxs("div",{className:`flex items-center px-4 py-2 border-b-2 cursor-pointer text-sm font-medium ${o===M?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,onDoubleClick:()=>{b(M),w(D.name)},onClick:()=>c(M),children:[m===M?N.jsx("input",{type:"text",value:x,onChange:F=>w(F.target.value),onBlur:()=>O(M),onKeyDown:F=>F.key==="Enter"&&O(M),className:"text-sm p-0 border-none focus:ring-0 bg-transparent",autoFocus:!0}):N.jsx("span",{children:D.name}),N.jsx("button",{onClick:F=>{F.stopPropagation(),A(M)},className:"ml-2 text-gray-400 hover:text-gray-600 w-4 h-4 flex items-center justify-center",children:"×"})]},M)),N.jsx("button",{onClick:k,className:"ml-2 px-3 py-1 text-sm text-gray-500 hover:text-gray-700",children:"+"})]}),N.jsx("textarea",{value:f,onChange:D=>{d(D.target.value),g(null)},className:"w-full h-full p-3 border border-gray-300 rounded-lg font-mono text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"}),p&&N.jsx("p",{className:"mt-2 text-sm text-red-600",children:p})]}),N.jsxs("div",{className:"flex justify-end gap-3 p-6 border-t border-gray-200 bg-gray-50 rounded-b-lg",children:[N.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"取消"}),N.jsx("button",{onClick:S,className:"px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"保存并使用"})]})]})})},fL=({isOpen:e,onClose:t,initialJson:n})=>{const[r,s]=W.useState(""),[l,o]=W.useState(null),[c,f]=W.useState([]);W.useEffect(()=>{if(e){let p="";if(n)if(typeof n=="string")p=n;else try{p=JSON.stringify(n,null,2)}catch(g){console.error("Failed to stringify initial JSON",g),p=""}else p=JSON.stringify([],null,2);s(p),o(null);try{d(p)}catch(g){console.error("Failed to parse initial JSON",g)}}},[e,n]);const d=p=>{try{const g=JSON.parse(p);let m=[];if(Array.isArray(g)?m=g:m=g.messages,!Array.isArray(m))throw new Error("JSON 格式无效,请检查后重试");f(m),o(null)}catch(g){o("JSON 格式无效,请检查后重试"),console.error("Invalid JSON format:",g)}};return W.useEffect(()=>{r&&d(r)},[r]),e?N.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:N.jsxs("div",{className:"bg-white rounded-lg shadow-xl w-[90%] max-w-[1200px] h-[80vh] max-h-[800px] flex flex-col overflow-hidden",children:[N.jsxs("div",{className:"flex justify-between items-center p-4 border-b border-gray-200",children:[N.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"JSON 消息预览"}),N.jsx("button",{onClick:t,className:"p-1.5 text-gray-500 hover:text-gray-900 transition-colors rounded-lg hover:bg-gray-100",children:N.jsx(QS,{className:"w-5 h-5"})})]}),N.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[N.jsxs("div",{className:"flex-1 p-4 flex flex-col border-r border-gray-200",children:[N.jsx("textarea",{value:r,onChange:p=>s(p.target.value),rows:20,placeholder:"输入JSON消息格式...",className:"flex-1 font-mono text-sm p-3 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none"}),l&&N.jsx("p",{className:"mt-2 text-sm text-red-600",children:l})]}),N.jsx("div",{className:"flex-1 p-4 overflow-y-auto bg-gray-50",children:N.jsx("div",{className:"bg-white rounded-lg p-4 min-h-full",children:(c==null?void 0:c.length)>0?N.jsx(Nm,{renderMessages:c,collapsedTools:[],toggleToolCollapse:()=>{},client:null}):N.jsx("div",{className:"flex items-center justify-center h-full text-gray-500 italic",children:"请输入有效的JSON以查看消息预览"})})})]})]})}):null},dL=()=>{const[e,t]=W.useState(!1);return N.jsxs(N.Fragment,{children:[N.jsxs("button",{onClick:()=>t(!0),className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",children:[N.jsx(XS,{className:"w-4 h-4"}),"JSON 消息"]}),N.jsx(fL,{isOpen:e,onClose:()=>t(!1)})]})};function Nt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Nt(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var hL={value:()=>{}};function Xc(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new lc(n)}function lc(e){this._=e}function pL(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}lc.prototype=Xc.prototype={constructor:lc,on:function(e,t){var n=this._,r=pL(e+"",n),s,l=-1,o=r.length;if(arguments.length<2){for(;++l<o;)if((s=(e=r[l]).type)&&(s=gL(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<o;)if(s=(e=r[l]).type)n[s]=k1(n[s],e.name,t);else if(t==null)for(s in n)n[s]=k1(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new lc(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,l;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],r=0,s=l.length;r<s;++r)l[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,l=r.length;s<l;++s)r[s].value.apply(t,n)}};function gL(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function k1(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=hL,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Hg="http://www.w3.org/1999/xhtml";const E1={svg:"http://www.w3.org/2000/svg",xhtml:Hg,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Qc(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),E1.hasOwnProperty(t)?{space:E1[t],local:e}:e}function mL(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Hg&&t.documentElement.namespaceURI===Hg?t.createElement(e):t.createElementNS(n,e)}}function yL(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function bk(e){var t=Qc(e);return(t.local?yL:mL)(t)}function bL(){}function Cm(e){return e==null?bL:function(){return this.querySelector(e)}}function vL(e){typeof e!="function"&&(e=Cm(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var l=t[s],o=l.length,c=r[s]=new Array(o),f,d,p=0;p<o;++p)(f=l[p])&&(d=e.call(f,f.__data__,p,l))&&("__data__"in f&&(d.__data__=f.__data__),c[p]=d);return new _n(r,this._parents)}function xL(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function wL(){return[]}function vk(e){return e==null?wL:function(){return this.querySelectorAll(e)}}function _L(e){return function(){return xL(e.apply(this,arguments))}}function SL(e){typeof e=="function"?e=_L(e):e=vk(e);for(var t=this._groups,n=t.length,r=[],s=[],l=0;l<n;++l)for(var o=t[l],c=o.length,f,d=0;d<c;++d)(f=o[d])&&(r.push(e.call(f,f.__data__,d,o)),s.push(f));return new _n(r,s)}function xk(e){return function(){return this.matches(e)}}function wk(e){return function(t){return t.matches(e)}}var kL=Array.prototype.find;function EL(e){return function(){return kL.call(this.children,e)}}function AL(){return this.firstElementChild}function TL(e){return this.select(e==null?AL:EL(typeof e=="function"?e:wk(e)))}var NL=Array.prototype.filter;function CL(){return Array.from(this.children)}function OL(e){return function(){return NL.call(this.children,e)}}function ML(e){return this.selectAll(e==null?CL:OL(typeof e=="function"?e:wk(e)))}function RL(e){typeof e!="function"&&(e=xk(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var l=t[s],o=l.length,c=r[s]=[],f,d=0;d<o;++d)(f=l[d])&&e.call(f,f.__data__,d,l)&&c.push(f);return new _n(r,this._parents)}function _k(e){return new Array(e.length)}function DL(){return new _n(this._enter||this._groups.map(_k),this._parents)}function kc(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}kc.prototype={constructor:kc,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function jL(e){return function(){return e}}function zL(e,t,n,r,s,l){for(var o=0,c,f=t.length,d=l.length;o<d;++o)(c=t[o])?(c.__data__=l[o],r[o]=c):n[o]=new kc(e,l[o]);for(;o<f;++o)(c=t[o])&&(s[o]=c)}function LL(e,t,n,r,s,l,o){var c,f,d=new Map,p=t.length,g=l.length,m=new Array(p),b;for(c=0;c<p;++c)(f=t[c])&&(m[c]=b=o.call(f,f.__data__,c,t)+"",d.has(b)?s[c]=f:d.set(b,f));for(c=0;c<g;++c)b=o.call(e,l[c],c,l)+"",(f=d.get(b))?(r[c]=f,f.__data__=l[c],d.delete(b)):n[c]=new kc(e,l[c]);for(c=0;c<p;++c)(f=t[c])&&d.get(m[c])===f&&(s[c]=f)}function IL(e){return e.__data__}function BL(e,t){if(!arguments.length)return Array.from(this,IL);var n=t?LL:zL,r=this._parents,s=this._groups;typeof e!="function"&&(e=jL(e));for(var l=s.length,o=new Array(l),c=new Array(l),f=new Array(l),d=0;d<l;++d){var p=r[d],g=s[d],m=g.length,b=FL(e.call(p,p&&p.__data__,d,r)),x=b.length,w=c[d]=new Array(x),_=o[d]=new Array(x),k=f[d]=new Array(m);n(p,g,w,_,k,b,t);for(var A=0,S=0,O,D;A<x;++A)if(O=w[A]){for(A>=S&&(S=A+1);!(D=_[S])&&++S<x;);O._next=D||null}}return o=new _n(o,r),o._enter=c,o._exit=f,o}function FL(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function PL(){return new _n(this._exit||this._groups.map(_k),this._parents)}function UL(e,t,n){var r=this.enter(),s=this,l=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?l.remove():n(l),r&&s?r.merge(s).order():s}function HL(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,l=r.length,o=Math.min(s,l),c=new Array(s),f=0;f<o;++f)for(var d=n[f],p=r[f],g=d.length,m=c[f]=new Array(g),b,x=0;x<g;++x)(b=d[x]||p[x])&&(m[x]=b);for(;f<s;++f)c[f]=n[f];return new _n(c,this._parents)}function $L(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],s=r.length-1,l=r[s],o;--s>=0;)(o=r[s])&&(l&&o.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(o,l),l=o);return this}function VL(e){e||(e=qL);function t(g,m){return g&&m?e(g.__data__,m.__data__):!g-!m}for(var n=this._groups,r=n.length,s=new Array(r),l=0;l<r;++l){for(var o=n[l],c=o.length,f=s[l]=new Array(c),d,p=0;p<c;++p)(d=o[p])&&(f[p]=d);f.sort(t)}return new _n(s,this._parents).order()}function qL(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function GL(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ZL(){return Array.from(this)}function YL(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,l=r.length;s<l;++s){var o=r[s];if(o)return o}return null}function XL(){let e=0;for(const t of this)++e;return e}function QL(){return!this.node()}function KL(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],l=0,o=s.length,c;l<o;++l)(c=s[l])&&e.call(c,c.__data__,l,s);return this}function JL(e){return function(){this.removeAttribute(e)}}function WL(e){return function(){this.removeAttributeNS(e.space,e.local)}}function e9(e,t){return function(){this.setAttribute(e,t)}}function t9(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function n9(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function r9(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function i9(e,t){var n=Qc(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?WL:JL:typeof t=="function"?n.local?r9:n9:n.local?t9:e9)(n,t))}function Sk(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function a9(e){return function(){this.style.removeProperty(e)}}function s9(e,t,n){return function(){this.style.setProperty(e,t,n)}}function l9(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function o9(e,t,n){return arguments.length>1?this.each((t==null?a9:typeof t=="function"?l9:s9)(e,t,n??"")):hs(this.node(),e)}function hs(e,t){return e.style.getPropertyValue(t)||Sk(e).getComputedStyle(e,null).getPropertyValue(t)}function u9(e){return function(){delete this[e]}}function c9(e,t){return function(){this[e]=t}}function f9(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function d9(e,t){return arguments.length>1?this.each((t==null?u9:typeof t=="function"?f9:c9)(e,t)):this.node()[e]}function kk(e){return e.trim().split(/^|\s+/)}function Om(e){return e.classList||new Ek(e)}function Ek(e){this._node=e,this._names=kk(e.getAttribute("class")||"")}Ek.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Ak(e,t){for(var n=Om(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function Tk(e,t){for(var n=Om(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function h9(e){return function(){Ak(this,e)}}function p9(e){return function(){Tk(this,e)}}function g9(e,t){return function(){(t.apply(this,arguments)?Ak:Tk)(this,e)}}function m9(e,t){var n=kk(e+"");if(arguments.length<2){for(var r=Om(this.node()),s=-1,l=n.length;++s<l;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?g9:t?h9:p9)(n,t))}function y9(){this.textContent=""}function b9(e){return function(){this.textContent=e}}function v9(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function x9(e){return arguments.length?this.each(e==null?y9:(typeof e=="function"?v9:b9)(e)):this.node().textContent}function w9(){this.innerHTML=""}function _9(e){return function(){this.innerHTML=e}}function S9(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function k9(e){return arguments.length?this.each(e==null?w9:(typeof e=="function"?S9:_9)(e)):this.node().innerHTML}function E9(){this.nextSibling&&this.parentNode.appendChild(this)}function A9(){return this.each(E9)}function T9(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function N9(){return this.each(T9)}function C9(e){var t=typeof e=="function"?e:bk(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function O9(){return null}function M9(e,t){var n=typeof e=="function"?e:bk(e),r=t==null?O9:typeof t=="function"?t:Cm(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function R9(){var e=this.parentNode;e&&e.removeChild(this)}function D9(){return this.each(R9)}function j9(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function z9(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function L9(e){return this.select(e?z9:j9)}function I9(e){return arguments.length?this.property("__data__",e):this.node().__data__}function B9(e){return function(t){e.call(this,t,this.__data__)}}function F9(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function P9(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,l;n<s;++n)l=t[n],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++r]=l;++r?t.length=r:delete this.__on}}}function U9(e,t,n){return function(){var r=this.__on,s,l=B9(t);if(r){for(var o=0,c=r.length;o<c;++o)if((s=r[o]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=l,s.options=n),s.value=t;return}}this.addEventListener(e.type,l,n),s={type:e.type,name:e.name,value:t,listener:l,options:n},r?r.push(s):this.__on=[s]}}function H9(e,t,n){var r=F9(e+""),s,l=r.length,o;if(arguments.length<2){var c=this.node().__on;if(c){for(var f=0,d=c.length,p;f<d;++f)for(s=0,p=c[f];s<l;++s)if((o=r[s]).type===p.type&&o.name===p.name)return p.value}return}for(c=t?U9:P9,s=0;s<l;++s)this.each(c(r[s],t,n));return this}function Nk(e,t,n){var r=Sk(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,n):(s=r.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function $9(e,t){return function(){return Nk(this,e,t)}}function V9(e,t){return function(){return Nk(this,e,t.apply(this,arguments))}}function q9(e,t){return this.each((typeof t=="function"?V9:$9)(e,t))}function*G9(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,l=r.length,o;s<l;++s)(o=r[s])&&(yield o)}var Ck=[null];function _n(e,t){this._groups=e,this._parents=t}function co(){return new _n([[document.documentElement]],Ck)}function Z9(){return this}_n.prototype=co.prototype={constructor:_n,select:vL,selectAll:SL,selectChild:TL,selectChildren:ML,filter:RL,data:BL,enter:DL,exit:PL,join:UL,merge:HL,selection:Z9,order:$L,sort:VL,call:GL,nodes:ZL,node:YL,size:XL,empty:QL,each:KL,attr:i9,style:o9,property:d9,classed:m9,text:x9,html:k9,raise:A9,lower:N9,append:C9,insert:M9,remove:D9,clone:L9,datum:I9,on:H9,dispatch:q9,[Symbol.iterator]:G9};function vn(e){return typeof e=="string"?new _n([[document.querySelector(e)]],[document.documentElement]):new _n([[e]],Ck)}function Y9(e){let t;for(;t=e.sourceEvent;)e=t;return e}function $n(e,t){if(e=Y9(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const X9={passive:!1},Ql={capture:!0,passive:!1};function op(e){e.stopImmediatePropagation()}function is(e){e.preventDefault(),e.stopImmediatePropagation()}function Ok(e){var t=e.document.documentElement,n=vn(e).on("dragstart.drag",is,Ql);"onselectstart"in t?n.on("selectstart.drag",is,Ql):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Mk(e,t){var n=e.document.documentElement,r=vn(e).on("dragstart.drag",null);t&&(r.on("click.drag",is,Ql),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Zu=e=>()=>e;function $g(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:l,x:o,y:c,dx:f,dy:d,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:p}})}$g.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Q9(e){return!e.ctrlKey&&!e.button}function K9(){return this.parentNode}function J9(e,t){return t??{x:e.x,y:e.y}}function W9(){return navigator.maxTouchPoints||"ontouchstart"in this}function Rk(){var e=Q9,t=K9,n=J9,r=W9,s={},l=Xc("start","drag","end"),o=0,c,f,d,p,g=0;function m(O){O.on("mousedown.drag",b).filter(r).on("touchstart.drag",_).on("touchmove.drag",k,X9).on("touchend.drag touchcancel.drag",A).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(O,D){if(!(p||!e.call(this,O,D))){var M=S(this,t.call(this,O,D),O,D,"mouse");M&&(vn(O.view).on("mousemove.drag",x,Ql).on("mouseup.drag",w,Ql),Ok(O.view),op(O),d=!1,c=O.clientX,f=O.clientY,M("start",O))}}function x(O){if(is(O),!d){var D=O.clientX-c,M=O.clientY-f;d=D*D+M*M>g}s.mouse("drag",O)}function w(O){vn(O.view).on("mousemove.drag mouseup.drag",null),Mk(O.view,d),is(O),s.mouse("end",O)}function _(O,D){if(e.call(this,O,D)){var M=O.changedTouches,F=t.call(this,O,D),L=M.length,U,j;for(U=0;U<L;++U)(j=S(this,F,O,D,M[U].identifier,M[U]))&&(op(O),j("start",O,M[U]))}}function k(O){var D=O.changedTouches,M=D.length,F,L;for(F=0;F<M;++F)(L=s[D[F].identifier])&&(is(O),L("drag",O,D[F]))}function A(O){var D=O.changedTouches,M=D.length,F,L;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),F=0;F<M;++F)(L=s[D[F].identifier])&&(op(O),L("end",O,D[F]))}function S(O,D,M,F,L,U){var j=l.copy(),H=$n(U||M,D),B,q,R;if((R=n.call(O,new $g("beforestart",{sourceEvent:M,target:m,identifier:L,active:o,x:H[0],y:H[1],dx:0,dy:0,dispatch:j}),F))!=null)return B=R.x-H[0]||0,q=R.y-H[1]||0,function $(I,P,Y){var X=H,E;switch(I){case"start":s[L]=$,E=o++;break;case"end":delete s[L],--o;case"drag":H=$n(Y||P,D),E=o;break}j.call(I,O,new $g(I,{sourceEvent:P,subject:R,target:m,identifier:L,active:E,x:H[0]+B,y:H[1]+q,dx:H[0]-X[0],dy:H[1]-X[1],dispatch:j}),F)}}return m.filter=function(O){return arguments.length?(e=typeof O=="function"?O:Zu(!!O),m):e},m.container=function(O){return arguments.length?(t=typeof O=="function"?O:Zu(O),m):t},m.subject=function(O){return arguments.length?(n=typeof O=="function"?O:Zu(O),m):n},m.touchable=function(O){return arguments.length?(r=typeof O=="function"?O:Zu(!!O),m):r},m.on=function(){var O=l.on.apply(l,arguments);return O===l?m:O},m.clickDistance=function(O){return arguments.length?(g=(O=+O)*O,m):Math.sqrt(g)},m}function Mm(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Dk(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function fo(){}var Kl=.7,Ec=1/Kl,as="\\s*([+-]?\\d+)\\s*",Jl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",lr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",eI=/^#([0-9a-f]{3,8})$/,tI=new RegExp(`^rgb\\(${as},${as},${as}\\)$`),nI=new RegExp(`^rgb\\(${lr},${lr},${lr}\\)$`),rI=new RegExp(`^rgba\\(${as},${as},${as},${Jl}\\)$`),iI=new RegExp(`^rgba\\(${lr},${lr},${lr},${Jl}\\)$`),aI=new RegExp(`^hsl\\(${Jl},${lr},${lr}\\)$`),sI=new RegExp(`^hsla\\(${Jl},${lr},${lr},${Jl}\\)$`),A1={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Mm(fo,Wl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:T1,formatHex:T1,formatHex8:lI,formatHsl:oI,formatRgb:N1,toString:N1});function T1(){return this.rgb().formatHex()}function lI(){return this.rgb().formatHex8()}function oI(){return jk(this).formatHsl()}function N1(){return this.rgb().formatRgb()}function Wl(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=eI.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?C1(t):n===3?new ln(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Yu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Yu(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=tI.exec(e))?new ln(t[1],t[2],t[3],1):(t=nI.exec(e))?new ln(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=rI.exec(e))?Yu(t[1],t[2],t[3],t[4]):(t=iI.exec(e))?Yu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=aI.exec(e))?R1(t[1],t[2]/100,t[3]/100,1):(t=sI.exec(e))?R1(t[1],t[2]/100,t[3]/100,t[4]):A1.hasOwnProperty(e)?C1(A1[e]):e==="transparent"?new ln(NaN,NaN,NaN,0):null}function C1(e){return new ln(e>>16&255,e>>8&255,e&255,1)}function Yu(e,t,n,r){return r<=0&&(e=t=n=NaN),new ln(e,t,n,r)}function uI(e){return e instanceof fo||(e=Wl(e)),e?(e=e.rgb(),new ln(e.r,e.g,e.b,e.opacity)):new ln}function Vg(e,t,n,r){return arguments.length===1?uI(e):new ln(e,t,n,r??1)}function ln(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Mm(ln,Vg,Dk(fo,{brighter(e){return e=e==null?Ec:Math.pow(Ec,e),new ln(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Kl:Math.pow(Kl,e),new ln(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ln(ta(this.r),ta(this.g),ta(this.b),Ac(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:O1,formatHex:O1,formatHex8:cI,formatRgb:M1,toString:M1}));function O1(){return`#${Ji(this.r)}${Ji(this.g)}${Ji(this.b)}`}function cI(){return`#${Ji(this.r)}${Ji(this.g)}${Ji(this.b)}${Ji((isNaN(this.opacity)?1:this.opacity)*255)}`}function M1(){const e=Ac(this.opacity);return`${e===1?"rgb(":"rgba("}${ta(this.r)}, ${ta(this.g)}, ${ta(this.b)}${e===1?")":`, ${e})`}`}function Ac(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ta(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ji(e){return e=ta(e),(e<16?"0":"")+e.toString(16)}function R1(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Vn(e,t,n,r)}function jk(e){if(e instanceof Vn)return new Vn(e.h,e.s,e.l,e.opacity);if(e instanceof fo||(e=Wl(e)),!e)return new Vn;if(e instanceof Vn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),l=Math.max(t,n,r),o=NaN,c=l-s,f=(l+s)/2;return c?(t===l?o=(n-r)/c+(n<r)*6:n===l?o=(r-t)/c+2:o=(t-n)/c+4,c/=f<.5?l+s:2-l-s,o*=60):c=f>0&&f<1?0:o,new Vn(o,c,f,e.opacity)}function fI(e,t,n,r){return arguments.length===1?jk(e):new Vn(e,t,n,r??1)}function Vn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Mm(Vn,fI,Dk(fo,{brighter(e){return e=e==null?Ec:Math.pow(Ec,e),new Vn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Kl:Math.pow(Kl,e),new Vn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new ln(up(e>=240?e-240:e+120,s,r),up(e,s,r),up(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Vn(D1(this.h),Xu(this.s),Xu(this.l),Ac(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ac(this.opacity);return`${e===1?"hsl(":"hsla("}${D1(this.h)}, ${Xu(this.s)*100}%, ${Xu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function D1(e){return e=(e||0)%360,e<0?e+360:e}function Xu(e){return Math.max(0,Math.min(1,e||0))}function up(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const zk=e=>()=>e;function dI(e,t){return function(n){return e+n*t}}function hI(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function pI(e){return(e=+e)==1?Lk:function(t,n){return n-t?hI(t,n,e):zk(isNaN(t)?n:t)}}function Lk(e,t){var n=t-e;return n?dI(e,n):zk(isNaN(e)?t:e)}const j1=function e(t){var n=pI(t);function r(s,l){var o=n((s=Vg(s)).r,(l=Vg(l)).r),c=n(s.g,l.g),f=n(s.b,l.b),d=Lk(s.opacity,l.opacity);return function(p){return s.r=o(p),s.g=c(p),s.b=f(p),s.opacity=d(p),s+""}}return r.gamma=e,r}(1);function yi(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var qg=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,cp=new RegExp(qg.source,"g");function gI(e){return function(){return e}}function mI(e){return function(t){return e(t)+""}}function yI(e,t){var n=qg.lastIndex=cp.lastIndex=0,r,s,l,o=-1,c=[],f=[];for(e=e+"",t=t+"";(r=qg.exec(e))&&(s=cp.exec(t));)(l=s.index)>n&&(l=t.slice(n,l),c[o]?c[o]+=l:c[++o]=l),(r=r[0])===(s=s[0])?c[o]?c[o]+=s:c[++o]=s:(c[++o]=null,f.push({i:o,x:yi(r,s)})),n=cp.lastIndex;return n<t.length&&(l=t.slice(n),c[o]?c[o]+=l:c[++o]=l),c.length<2?f[0]?mI(f[0].x):gI(t):(t=f.length,function(d){for(var p=0,g;p<t;++p)c[(g=f[p]).i]=g.x(d);return c.join("")})}var z1=180/Math.PI,Gg={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ik(e,t,n,r,s,l){var o,c,f;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(f=e*n+t*r)&&(n-=e*f,r-=t*f),(c=Math.sqrt(n*n+r*r))&&(n/=c,r/=c,f/=c),e*r<t*n&&(e=-e,t=-t,f=-f,o=-o),{translateX:s,translateY:l,rotate:Math.atan2(t,e)*z1,skewX:Math.atan(f)*z1,scaleX:o,scaleY:c}}var Qu;function bI(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Gg:Ik(t.a,t.b,t.c,t.d,t.e,t.f)}function vI(e){return e==null||(Qu||(Qu=document.createElementNS("http://www.w3.org/2000/svg","g")),Qu.setAttribute("transform",e),!(e=Qu.transform.baseVal.consolidate()))?Gg:(e=e.matrix,Ik(e.a,e.b,e.c,e.d,e.e,e.f))}function Bk(e,t,n,r){function s(d){return d.length?d.pop()+" ":""}function l(d,p,g,m,b,x){if(d!==g||p!==m){var w=b.push("translate(",null,t,null,n);x.push({i:w-4,x:yi(d,g)},{i:w-2,x:yi(p,m)})}else(g||m)&&b.push("translate("+g+t+m+n)}function o(d,p,g,m){d!==p?(d-p>180?p+=360:p-d>180&&(d+=360),m.push({i:g.push(s(g)+"rotate(",null,r)-2,x:yi(d,p)})):p&&g.push(s(g)+"rotate("+p+r)}function c(d,p,g,m){d!==p?m.push({i:g.push(s(g)+"skewX(",null,r)-2,x:yi(d,p)}):p&&g.push(s(g)+"skewX("+p+r)}function f(d,p,g,m,b,x){if(d!==g||p!==m){var w=b.push(s(b)+"scale(",null,",",null,")");x.push({i:w-4,x:yi(d,g)},{i:w-2,x:yi(p,m)})}else(g!==1||m!==1)&&b.push(s(b)+"scale("+g+","+m+")")}return function(d,p){var g=[],m=[];return d=e(d),p=e(p),l(d.translateX,d.translateY,p.translateX,p.translateY,g,m),o(d.rotate,p.rotate,g,m),c(d.skewX,p.skewX,g,m),f(d.scaleX,d.scaleY,p.scaleX,p.scaleY,g,m),d=p=null,function(b){for(var x=-1,w=m.length,_;++x<w;)g[(_=m[x]).i]=_.x(b);return g.join("")}}}var xI=Bk(bI,"px, ","px)","deg)"),wI=Bk(vI,", ",")",")"),_I=1e-12;function L1(e){return((e=Math.exp(e))+1/e)/2}function SI(e){return((e=Math.exp(e))-1/e)/2}function kI(e){return((e=Math.exp(2*e))-1)/(e+1)}const EI=function e(t,n,r){function s(l,o){var c=l[0],f=l[1],d=l[2],p=o[0],g=o[1],m=o[2],b=p-c,x=g-f,w=b*b+x*x,_,k;if(w<_I)k=Math.log(m/d)/t,_=function(F){return[c+F*b,f+F*x,d*Math.exp(t*F*k)]};else{var A=Math.sqrt(w),S=(m*m-d*d+r*w)/(2*d*n*A),O=(m*m-d*d-r*w)/(2*m*n*A),D=Math.log(Math.sqrt(S*S+1)-S),M=Math.log(Math.sqrt(O*O+1)-O);k=(M-D)/t,_=function(F){var L=F*k,U=L1(D),j=d/(n*A)*(U*kI(t*L+D)-SI(D));return[c+j*b,f+j*x,d*U/L1(t*L+D)]}}return _.duration=k*1e3*t/Math.SQRT2,_}return s.rho=function(l){var o=Math.max(.001,+l),c=o*o,f=c*c;return e(o,c,f)},s}(Math.SQRT2,2,4);var ps=0,Il=0,Dl=0,Fk=1e3,Tc,Bl,Nc=0,aa=0,Kc=0,eo=typeof performance=="object"&&performance.now?performance:Date,Pk=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Rm(){return aa||(Pk(AI),aa=eo.now()+Kc)}function AI(){aa=0}function Cc(){this._call=this._time=this._next=null}Cc.prototype=Uk.prototype={constructor:Cc,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Rm():+n)+(t==null?0:+t),!this._next&&Bl!==this&&(Bl?Bl._next=this:Tc=this,Bl=this),this._call=e,this._time=n,Zg()},stop:function(){this._call&&(this._call=null,this._time=1/0,Zg())}};function Uk(e,t,n){var r=new Cc;return r.restart(e,t,n),r}function TI(){Rm(),++ps;for(var e=Tc,t;e;)(t=aa-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ps}function I1(){aa=(Nc=eo.now())+Kc,ps=Il=0;try{TI()}finally{ps=0,CI(),aa=0}}function NI(){var e=eo.now(),t=e-Nc;t>Fk&&(Kc-=t,Nc=e)}function CI(){for(var e,t=Tc,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Tc=n);Bl=e,Zg(r)}function Zg(e){if(!ps){Il&&(Il=clearTimeout(Il));var t=e-aa;t>24?(e<1/0&&(Il=setTimeout(I1,e-eo.now()-Kc)),Dl&&(Dl=clearInterval(Dl))):(Dl||(Nc=eo.now(),Dl=setInterval(NI,Fk)),ps=1,Pk(I1))}}function B1(e,t,n){var r=new Cc;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var OI=Xc("start","end","cancel","interrupt"),MI=[],Hk=0,F1=1,Yg=2,oc=3,P1=4,Xg=5,uc=6;function Jc(e,t,n,r,s,l){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;RI(e,n,{name:t,index:r,group:s,on:OI,tween:MI,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:Hk})}function Dm(e,t){var n=Yn(e,t);if(n.state>Hk)throw new Error("too late; already scheduled");return n}function cr(e,t){var n=Yn(e,t);if(n.state>oc)throw new Error("too late; already running");return n}function Yn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function RI(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=Uk(l,0,n.time);function l(d){n.state=F1,n.timer.restart(o,n.delay,n.time),n.delay<=d&&o(d-n.delay)}function o(d){var p,g,m,b;if(n.state!==F1)return f();for(p in r)if(b=r[p],b.name===n.name){if(b.state===oc)return B1(o);b.state===P1?(b.state=uc,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete r[p]):+p<t&&(b.state=uc,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete r[p])}if(B1(function(){n.state===oc&&(n.state=P1,n.timer.restart(c,n.delay,n.time),c(d))}),n.state=Yg,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Yg){for(n.state=oc,s=new Array(m=n.tween.length),p=0,g=-1;p<m;++p)(b=n.tween[p].value.call(e,e.__data__,n.index,n.group))&&(s[++g]=b);s.length=g+1}}function c(d){for(var p=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(f),n.state=Xg,1),g=-1,m=s.length;++g<m;)s[g].call(e,p);n.state===Xg&&(n.on.call("end",e,e.__data__,n.index,n.group),f())}function f(){n.state=uc,n.timer.stop(),delete r[t];for(var d in r)return;delete e.__transition}}function cc(e,t){var n=e.__transition,r,s,l=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){l=!1;continue}s=r.state>Yg&&r.state<Xg,r.state=uc,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}l&&delete e.__transition}}function DI(e){return this.each(function(){cc(this,e)})}function jI(e,t){var n,r;return function(){var s=cr(this,e),l=s.tween;if(l!==n){r=n=l;for(var o=0,c=r.length;o<c;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}s.tween=r}}function zI(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var l=cr(this,e),o=l.tween;if(o!==r){s=(r=o).slice();for(var c={name:t,value:n},f=0,d=s.length;f<d;++f)if(s[f].name===t){s[f]=c;break}f===d&&s.push(c)}l.tween=s}}function LI(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Yn(this.node(),n).tween,s=0,l=r.length,o;s<l;++s)if((o=r[s]).name===e)return o.value;return null}return this.each((t==null?jI:zI)(n,e,t))}function jm(e,t,n){var r=e._id;return e.each(function(){var s=cr(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return Yn(s,r).value[t]}}function $k(e,t){var n;return(typeof t=="number"?yi:t instanceof Wl?j1:(n=Wl(t))?(t=n,j1):yI)(e,t)}function II(e){return function(){this.removeAttribute(e)}}function BI(e){return function(){this.removeAttributeNS(e.space,e.local)}}function FI(e,t,n){var r,s=n+"",l;return function(){var o=this.getAttribute(e);return o===s?null:o===r?l:l=t(r=o,n)}}function PI(e,t,n){var r,s=n+"",l;return function(){var o=this.getAttributeNS(e.space,e.local);return o===s?null:o===r?l:l=t(r=o,n)}}function UI(e,t,n){var r,s,l;return function(){var o,c=n(this),f;return c==null?void this.removeAttribute(e):(o=this.getAttribute(e),f=c+"",o===f?null:o===r&&f===s?l:(s=f,l=t(r=o,c)))}}function HI(e,t,n){var r,s,l;return function(){var o,c=n(this),f;return c==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),f=c+"",o===f?null:o===r&&f===s?l:(s=f,l=t(r=o,c)))}}function $I(e,t){var n=Qc(e),r=n==="transform"?wI:$k;return this.attrTween(e,typeof t=="function"?(n.local?HI:UI)(n,r,jm(this,"attr."+e,t)):t==null?(n.local?BI:II)(n):(n.local?PI:FI)(n,r,t))}function VI(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function qI(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function GI(e,t){var n,r;function s(){var l=t.apply(this,arguments);return l!==r&&(n=(r=l)&&qI(e,l)),n}return s._value=t,s}function ZI(e,t){var n,r;function s(){var l=t.apply(this,arguments);return l!==r&&(n=(r=l)&&VI(e,l)),n}return s._value=t,s}function YI(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Qc(e);return this.tween(n,(r.local?GI:ZI)(r,t))}function XI(e,t){return function(){Dm(this,e).delay=+t.apply(this,arguments)}}function QI(e,t){return t=+t,function(){Dm(this,e).delay=t}}function KI(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?XI:QI)(t,e)):Yn(this.node(),t).delay}function JI(e,t){return function(){cr(this,e).duration=+t.apply(this,arguments)}}function WI(e,t){return t=+t,function(){cr(this,e).duration=t}}function e6(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?JI:WI)(t,e)):Yn(this.node(),t).duration}function t6(e,t){if(typeof t!="function")throw new Error;return function(){cr(this,e).ease=t}}function n6(e){var t=this._id;return arguments.length?this.each(t6(t,e)):Yn(this.node(),t).ease}function r6(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;cr(this,e).ease=n}}function i6(e){if(typeof e!="function")throw new Error;return this.each(r6(this._id,e))}function a6(e){typeof e!="function"&&(e=xk(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var l=t[s],o=l.length,c=r[s]=[],f,d=0;d<o;++d)(f=l[d])&&e.call(f,f.__data__,d,l)&&c.push(f);return new zr(r,this._parents,this._name,this._id)}function s6(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,s=n.length,l=Math.min(r,s),o=new Array(r),c=0;c<l;++c)for(var f=t[c],d=n[c],p=f.length,g=o[c]=new Array(p),m,b=0;b<p;++b)(m=f[b]||d[b])&&(g[b]=m);for(;c<r;++c)o[c]=t[c];return new zr(o,this._parents,this._name,this._id)}function l6(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function o6(e,t,n){var r,s,l=l6(t)?Dm:cr;return function(){var o=l(this,e),c=o.on;c!==r&&(s=(r=c).copy()).on(t,n),o.on=s}}function u6(e,t){var n=this._id;return arguments.length<2?Yn(this.node(),n).on.on(e):this.each(o6(n,e,t))}function c6(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function f6(){return this.on("end.remove",c6(this._id))}function d6(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Cm(e));for(var r=this._groups,s=r.length,l=new Array(s),o=0;o<s;++o)for(var c=r[o],f=c.length,d=l[o]=new Array(f),p,g,m=0;m<f;++m)(p=c[m])&&(g=e.call(p,p.__data__,m,c))&&("__data__"in p&&(g.__data__=p.__data__),d[m]=g,Jc(d[m],t,n,m,d,Yn(p,n)));return new zr(l,this._parents,t,n)}function h6(e){var t=this._name,n=this._id;typeof e!="function"&&(e=vk(e));for(var r=this._groups,s=r.length,l=[],o=[],c=0;c<s;++c)for(var f=r[c],d=f.length,p,g=0;g<d;++g)if(p=f[g]){for(var m=e.call(p,p.__data__,g,f),b,x=Yn(p,n),w=0,_=m.length;w<_;++w)(b=m[w])&&Jc(b,t,n,w,m,x);l.push(m),o.push(p)}return new zr(l,o,t,n)}var p6=co.prototype.constructor;function g6(){return new p6(this._groups,this._parents)}function m6(e,t){var n,r,s;return function(){var l=hs(this,e),o=(this.style.removeProperty(e),hs(this,e));return l===o?null:l===n&&o===r?s:s=t(n=l,r=o)}}function Vk(e){return function(){this.style.removeProperty(e)}}function y6(e,t,n){var r,s=n+"",l;return function(){var o=hs(this,e);return o===s?null:o===r?l:l=t(r=o,n)}}function b6(e,t,n){var r,s,l;return function(){var o=hs(this,e),c=n(this),f=c+"";return c==null&&(f=c=(this.style.removeProperty(e),hs(this,e))),o===f?null:o===r&&f===s?l:(s=f,l=t(r=o,c))}}function v6(e,t){var n,r,s,l="style."+t,o="end."+l,c;return function(){var f=cr(this,e),d=f.on,p=f.value[l]==null?c||(c=Vk(t)):void 0;(d!==n||s!==p)&&(r=(n=d).copy()).on(o,s=p),f.on=r}}function x6(e,t,n){var r=(e+="")=="transform"?xI:$k;return t==null?this.styleTween(e,m6(e,r)).on("end.style."+e,Vk(e)):typeof t=="function"?this.styleTween(e,b6(e,r,jm(this,"style."+e,t))).each(v6(this._id,e)):this.styleTween(e,y6(e,r,t),n).on("end.style."+e,null)}function w6(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function _6(e,t,n){var r,s;function l(){var o=t.apply(this,arguments);return o!==s&&(r=(s=o)&&w6(e,o,n)),r}return l._value=t,l}function S6(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,_6(e,t,n??""))}function k6(e){return function(){this.textContent=e}}function E6(e){return function(){var t=e(this);this.textContent=t??""}}function A6(e){return this.tween("text",typeof e=="function"?E6(jm(this,"text",e)):k6(e==null?"":e+""))}function T6(e){return function(t){this.textContent=e.call(this,t)}}function N6(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&T6(s)),t}return r._value=e,r}function C6(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,N6(e))}function O6(){for(var e=this._name,t=this._id,n=qk(),r=this._groups,s=r.length,l=0;l<s;++l)for(var o=r[l],c=o.length,f,d=0;d<c;++d)if(f=o[d]){var p=Yn(f,t);Jc(f,e,n,d,o,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new zr(r,this._parents,e,n)}function M6(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(l,o){var c={value:o},f={value:function(){--s===0&&l()}};n.each(function(){var d=cr(this,r),p=d.on;p!==e&&(t=(e=p).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(f)),d.on=t}),s===0&&l()})}var R6=0;function zr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function qk(){return++R6}var Or=co.prototype;zr.prototype={constructor:zr,select:d6,selectAll:h6,selectChild:Or.selectChild,selectChildren:Or.selectChildren,filter:a6,merge:s6,selection:g6,transition:O6,call:Or.call,nodes:Or.nodes,node:Or.node,size:Or.size,empty:Or.empty,each:Or.each,on:u6,attr:$I,attrTween:YI,style:x6,styleTween:S6,text:A6,textTween:C6,remove:f6,tween:LI,delay:KI,duration:e6,ease:n6,easeVarying:i6,end:M6,[Symbol.iterator]:Or[Symbol.iterator]};function D6(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var j6={time:null,delay:0,duration:250,ease:D6};function z6(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function L6(e){var t,n;e instanceof zr?(t=e._id,e=e._name):(t=qk(),(n=j6).time=Rm(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,l=0;l<s;++l)for(var o=r[l],c=o.length,f,d=0;d<c;++d)(f=o[d])&&Jc(f,e,t,d,o,n||z6(f,t));return new zr(r,this._parents,e,t)}co.prototype.interrupt=DI;co.prototype.transition=L6;const Ku=e=>()=>e;function I6(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Mr(e,t,n){this.k=e,this.x=t,this.y=n}Mr.prototype={constructor:Mr,scale:function(e){return e===1?this:new Mr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Mr(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Wc=new Mr(1,0,0);Gk.prototype=Mr.prototype;function Gk(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Wc;return e.__zoom}function fp(e){e.stopImmediatePropagation()}function jl(e){e.preventDefault(),e.stopImmediatePropagation()}function B6(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function F6(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function U1(){return this.__zoom||Wc}function P6(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function U6(){return navigator.maxTouchPoints||"ontouchstart"in this}function H6(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],l=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),o>l?(l+o)/2:Math.min(0,l)||Math.max(0,o))}function Zk(){var e=B6,t=F6,n=H6,r=P6,s=U6,l=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],c=250,f=EI,d=Xc("start","zoom","end"),p,g,m,b=500,x=150,w=0,_=10;function k(R){R.property("__zoom",U1).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",U).on("dblclick.zoom",j).filter(s).on("touchstart.zoom",H).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(R,$,I,P){var Y=R.selection?R.selection():R;Y.property("__zoom",U1),R!==Y?D(R,$,I,P):Y.interrupt().each(function(){M(this,arguments).event(P).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},k.scaleBy=function(R,$,I,P){k.scaleTo(R,function(){var Y=this.__zoom.k,X=typeof $=="function"?$.apply(this,arguments):$;return Y*X},I,P)},k.scaleTo=function(R,$,I,P){k.transform(R,function(){var Y=t.apply(this,arguments),X=this.__zoom,E=I==null?O(Y):typeof I=="function"?I.apply(this,arguments):I,G=X.invert(E),te=typeof $=="function"?$.apply(this,arguments):$;return n(S(A(X,te),E,G),Y,o)},I,P)},k.translateBy=function(R,$,I,P){k.transform(R,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof I=="function"?I.apply(this,arguments):I),t.apply(this,arguments),o)},null,P)},k.translateTo=function(R,$,I,P,Y){k.transform(R,function(){var X=t.apply(this,arguments),E=this.__zoom,G=P==null?O(X):typeof P=="function"?P.apply(this,arguments):P;return n(Wc.translate(G[0],G[1]).scale(E.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof I=="function"?-I.apply(this,arguments):-I),X,o)},P,Y)};function A(R,$){return $=Math.max(l[0],Math.min(l[1],$)),$===R.k?R:new Mr($,R.x,R.y)}function S(R,$,I){var P=$[0]-I[0]*R.k,Y=$[1]-I[1]*R.k;return P===R.x&&Y===R.y?R:new Mr(R.k,P,Y)}function O(R){return[(+R[0][0]+ +R[1][0])/2,(+R[0][1]+ +R[1][1])/2]}function D(R,$,I,P){R.on("start.zoom",function(){M(this,arguments).event(P).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event(P).end()}).tween("zoom",function(){var Y=this,X=arguments,E=M(Y,X).event(P),G=t.apply(Y,X),te=I==null?O(G):typeof I=="function"?I.apply(Y,X):I,T=Math.max(G[1][0]-G[0][0],G[1][1]-G[0][1]),V=Y.__zoom,K=typeof $=="function"?$.apply(Y,X):$,J=f(V.invert(te).concat(T/V.k),K.invert(te).concat(T/K.k));return function(le){if(le===1)le=K;else{var fe=J(le),ye=T/fe[2];le=new Mr(ye,te[0]-fe[0]*ye,te[1]-fe[1]*ye)}E.zoom(null,le)}})}function M(R,$,I){return!I&&R.__zooming||new F(R,$)}function F(R,$){this.that=R,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(R,$),this.taps=0}F.prototype={event:function(R){return R&&(this.sourceEvent=R),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(R,$){return this.mouse&&R!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&R!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(R){var $=vn(this.that).datum();d.call(R,this.that,new I6(R,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:d}),$)}};function L(R,...$){if(!e.apply(this,arguments))return;var I=M(this,$).event(R),P=this.__zoom,Y=Math.max(l[0],Math.min(l[1],P.k*Math.pow(2,r.apply(this,arguments)))),X=$n(R);if(I.wheel)(I.mouse[0][0]!==X[0]||I.mouse[0][1]!==X[1])&&(I.mouse[1]=P.invert(I.mouse[0]=X)),clearTimeout(I.wheel);else{if(P.k===Y)return;I.mouse=[X,P.invert(X)],cc(this),I.start()}jl(R),I.wheel=setTimeout(E,x),I.zoom("mouse",n(S(A(P,Y),I.mouse[0],I.mouse[1]),I.extent,o));function E(){I.wheel=null,I.end()}}function U(R,...$){if(m||!e.apply(this,arguments))return;var I=R.currentTarget,P=M(this,$,!0).event(R),Y=vn(R.view).on("mousemove.zoom",te,!0).on("mouseup.zoom",T,!0),X=$n(R,I),E=R.clientX,G=R.clientY;Ok(R.view),fp(R),P.mouse=[X,this.__zoom.invert(X)],cc(this),P.start();function te(V){if(jl(V),!P.moved){var K=V.clientX-E,J=V.clientY-G;P.moved=K*K+J*J>w}P.event(V).zoom("mouse",n(S(P.that.__zoom,P.mouse[0]=$n(V,I),P.mouse[1]),P.extent,o))}function T(V){Y.on("mousemove.zoom mouseup.zoom",null),Mk(V.view,P.moved),jl(V),P.event(V).end()}}function j(R,...$){if(e.apply(this,arguments)){var I=this.__zoom,P=$n(R.changedTouches?R.changedTouches[0]:R,this),Y=I.invert(P),X=I.k*(R.shiftKey?.5:2),E=n(S(A(I,X),P,Y),t.apply(this,$),o);jl(R),c>0?vn(this).transition().duration(c).call(D,E,P,R):vn(this).call(k.transform,E,P,R)}}function H(R,...$){if(e.apply(this,arguments)){var I=R.touches,P=I.length,Y=M(this,$,R.changedTouches.length===P).event(R),X,E,G,te;for(fp(R),E=0;E<P;++E)G=I[E],te=$n(G,this),te=[te,this.__zoom.invert(te),G.identifier],Y.touch0?!Y.touch1&&Y.touch0[2]!==te[2]&&(Y.touch1=te,Y.taps=0):(Y.touch0=te,X=!0,Y.taps=1+!!p);p&&(p=clearTimeout(p)),X&&(Y.taps<2&&(g=te[0],p=setTimeout(function(){p=null},b)),cc(this),Y.start())}}function B(R,...$){if(this.__zooming){var I=M(this,$).event(R),P=R.changedTouches,Y=P.length,X,E,G,te;for(jl(R),X=0;X<Y;++X)E=P[X],G=$n(E,this),I.touch0&&I.touch0[2]===E.identifier?I.touch0[0]=G:I.touch1&&I.touch1[2]===E.identifier&&(I.touch1[0]=G);if(E=I.that.__zoom,I.touch1){var T=I.touch0[0],V=I.touch0[1],K=I.touch1[0],J=I.touch1[1],le=(le=K[0]-T[0])*le+(le=K[1]-T[1])*le,fe=(fe=J[0]-V[0])*fe+(fe=J[1]-V[1])*fe;E=A(E,Math.sqrt(le/fe)),G=[(T[0]+K[0])/2,(T[1]+K[1])/2],te=[(V[0]+J[0])/2,(V[1]+J[1])/2]}else if(I.touch0)G=I.touch0[0],te=I.touch0[1];else return;I.zoom("touch",n(S(E,G,te),I.extent,o))}}function q(R,...$){if(this.__zooming){var I=M(this,$).event(R),P=R.changedTouches,Y=P.length,X,E;for(fp(R),m&&clearTimeout(m),m=setTimeout(function(){m=null},b),X=0;X<Y;++X)E=P[X],I.touch0&&I.touch0[2]===E.identifier?delete I.touch0:I.touch1&&I.touch1[2]===E.identifier&&delete I.touch1;if(I.touch1&&!I.touch0&&(I.touch0=I.touch1,delete I.touch1),I.touch0)I.touch0[1]=this.__zoom.invert(I.touch0[0]);else if(I.end(),I.taps===2&&(E=$n(E,this),Math.hypot(g[0]-E[0],g[1]-E[1])<_)){var G=vn(this).on("dblclick.zoom");G&&G.apply(this,arguments)}}}return k.wheelDelta=function(R){return arguments.length?(r=typeof R=="function"?R:Ku(+R),k):r},k.filter=function(R){return arguments.length?(e=typeof R=="function"?R:Ku(!!R),k):e},k.touchable=function(R){return arguments.length?(s=typeof R=="function"?R:Ku(!!R),k):s},k.extent=function(R){return arguments.length?(t=typeof R=="function"?R:Ku([[+R[0][0],+R[0][1]],[+R[1][0],+R[1][1]]]),k):t},k.scaleExtent=function(R){return arguments.length?(l[0]=+R[0],l[1]=+R[1],k):[l[0],l[1]]},k.translateExtent=function(R){return arguments.length?(o[0][0]=+R[0][0],o[1][0]=+R[1][0],o[0][1]=+R[0][1],o[1][1]=+R[1][1],k):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},k.constrain=function(R){return arguments.length?(n=R,k):n},k.duration=function(R){return arguments.length?(c=+R,k):c},k.interpolate=function(R){return arguments.length?(f=R,k):f},k.on=function(){var R=d.on.apply(d,arguments);return R===d?k:R},k.clickDistance=function(R){return arguments.length?(w=(R=+R)*R,k):Math.sqrt(w)},k.tapDistance=function(R){return arguments.length?(_=+R,k):_},k}const or={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},to=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Yk=["Enter"," ","Escape"];var gs;(function(e){e.Strict="strict",e.Loose="loose"})(gs||(gs={}));var na;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(na||(na={}));var no;(function(e){e.Partial="partial",e.Full="full"})(no||(no={}));const Xk={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var bi;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(bi||(bi={}));var Oc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Oc||(Oc={}));var Ce;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ce||(Ce={}));const H1={[Ce.Left]:Ce.Right,[Ce.Right]:Ce.Left,[Ce.Top]:Ce.Bottom,[Ce.Bottom]:Ce.Top};function Qk(e){return e===null?null:e?"valid":"invalid"}const Kk=e=>"id"in e&&"source"in e&&"target"in e,$6=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),zm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ho=(e,t=[0,0])=>{const{width:n,height:r}=Ir(e),s=e.origin??t,l=n*s[0],o=r*s[1];return{x:e.position.x-l,y:e.position.y-o}},V6=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,s)=>{const l=typeof s=="string";let o=!t.nodeLookup&&!l?s:void 0;t.nodeLookup&&(o=l?t.nodeLookup.get(s):zm(s)?s:t.nodeLookup.get(s.id));const c=o?Mc(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ef(r,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return tf(n)},po=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(r=>{if(t.filter===void 0||t.filter(r)){const s=Mc(r);n=ef(n,s)}}),tf(n)},Jk=(e,t,[n,r,s]=[0,0,1],l=!1,o=!1)=>{const c={...go(t,[n,r,s]),width:t.width/s,height:t.height/s},f=[];for(const d of e.values()){const{measured:p,selectable:g=!0,hidden:m=!1}=d;if(o&&!g||m)continue;const b=p.width??d.width??d.initialWidth??null,x=p.height??d.height??d.initialHeight??null,w=ro(c,ys(d)),_=(b??0)*(x??0),k=l&&w>0;(!d.internals.handleBounds||k||w>=_||d.dragging)&&f.push(d)}return f},q6=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function G6(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&n.set(s.id,s)}),n}async function Z6({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:l},o){if(e.size===0)return Promise.resolve(!0);const c=G6(e,o),f=po(c),d=Lm(f,t,n,(o==null?void 0:o.minZoom)??s,(o==null?void 0:o.maxZoom)??l,(o==null?void 0:o.padding)??.1);return await r.setViewport(d,{duration:o==null?void 0:o.duration}),Promise.resolve(!0)}function Wk({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:l}){const o=n.get(e),c=o.parentId?n.get(o.parentId):void 0,{x:f,y:d}=c?c.internals.positionAbsolute:{x:0,y:0},p=o.origin??r;let g=s;if(o.extent==="parent"&&!o.expandParent)if(!c)l==null||l("005",or.error005());else{const b=c.measured.width,x=c.measured.height;b&&x&&(g=[[f,d],[f+b,d+x]])}else c&&bs(o.extent)&&(g=[[o.extent[0][0]+f,o.extent[0][1]+d],[o.extent[1][0]+f,o.extent[1][1]+d]]);const m=bs(g)?sa(t,g,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(l==null||l("015",or.error015())),{position:{x:m.x-f+(o.measured.width??0)*p[0],y:m.y-d+(o.measured.height??0)*p[1]},positionAbsolute:m}}async function Y6({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const l=new Set(e.map(m=>m.id)),o=[];for(const m of n){if(m.deletable===!1)continue;const b=l.has(m.id),x=!b&&m.parentId&&o.find(w=>w.id===m.parentId);(b||x)&&o.push(m)}const c=new Set(t.map(m=>m.id)),f=r.filter(m=>m.deletable!==!1),p=q6(o,f);for(const m of f)c.has(m.id)&&!p.find(x=>x.id===m.id)&&p.push(m);if(!s)return{edges:p,nodes:o};const g=await s({nodes:o,edges:p});return typeof g=="boolean"?g?{edges:p,nodes:o}:{edges:[],nodes:[]}:g}const ms=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),sa=(e={x:0,y:0},t,n)=>({x:ms(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:ms(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function eE(e,t,n){const{width:r,height:s}=Ir(n),{x:l,y:o}=n.internals.positionAbsolute;return sa(e,[[l,o],[l+r,o+s]],t)}const $1=(e,t,n)=>e<t?ms(Math.abs(e-t),1,t)/t:e>n?-ms(Math.abs(e-n),1,t)/t:0,tE=(e,t,n=15,r=40)=>{const s=$1(e.x,r,t.width-r)*n,l=$1(e.y,r,t.height-r)*n;return[s,l]},ef=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Qg=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),tf=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),ys=(e,t=[0,0])=>{var s,l;const{x:n,y:r}=zm(e)?e.internals.positionAbsolute:ho(e,t);return{x:n,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0}},Mc=(e,t=[0,0])=>{var s,l;const{x:n,y:r}=zm(e)?e.internals.positionAbsolute:ho(e,t);return{x:n,y:r,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0)}},nE=(e,t)=>tf(ef(Qg(e),Qg(t))),ro=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},V1=e=>qn(e.width)&&qn(e.height)&&qn(e.x)&&qn(e.y),qn=e=>!isNaN(e)&&isFinite(e),X6=(e,t)=>{},nf=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),go=({x:e,y:t},[n,r,s],l=!1,o=[1,1])=>{const c={x:(e-n)/s,y:(t-r)/s};return l?nf(c,o):c},Rc=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function Ka(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Q6(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Ka(e,n),s=Ka(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Ka(e.top??e.y??0,n),s=Ka(e.bottom??e.y??0,n),l=Ka(e.left??e.x??0,t),o=Ka(e.right??e.x??0,t);return{top:r,right:o,bottom:s,left:l,x:l+o,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function K6(e,t,n,r,s,l){const{x:o,y:c}=Rc(e,[t,n,r]),{x:f,y:d}=Rc({x:e.x+e.width,y:e.y+e.height},[t,n,r]),p=s-f,g=l-d;return{left:Math.floor(o),top:Math.floor(c),right:Math.floor(p),bottom:Math.floor(g)}}const Lm=(e,t,n,r,s,l)=>{const o=Q6(l,t,n),c=(t-o.x)/e.width,f=(n-o.y)/e.height,d=Math.min(c,f),p=ms(d,r,s),g=e.x+e.width/2,m=e.y+e.height/2,b=t/2-g*p,x=n/2-m*p,w=K6(e,b,x,p,t,n),_={left:Math.min(w.left-o.left,0),top:Math.min(w.top-o.top,0),right:Math.min(w.right-o.right,0),bottom:Math.min(w.bottom-o.bottom,0)};return{x:b-_.left+_.right,y:x-_.top+_.bottom,zoom:p}},Dc=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function bs(e){return e!==void 0&&e!=="parent"}function Ir(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function rE(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function iE(e,t={width:0,height:0},n,r,s){const l={...e},o=r.get(n);if(o){const c=o.origin||s;l.x+=o.internals.positionAbsolute.x-(t.width??0)*c[0],l.y+=o.internals.positionAbsolute.y-(t.height??0)*c[1]}return l}function q1(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function J6(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function Hl(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:l,y:o}=Dr(e),c=go({x:l-((s==null?void 0:s.left)??0),y:o-((s==null?void 0:s.top)??0)},r),{x:f,y:d}=n?nf(c,t):c;return{xSnapped:f,ySnapped:d,...c}}const Im=e=>({width:e.offsetWidth,height:e.offsetHeight}),aE=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},W6=["INPUT","SELECT","TEXTAREA"];function sE(e){var r,s;const t=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:W6.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const lE=e=>"clientX"in e,Dr=(e,t)=>{var l,o;const n=lE(e),r=n?e.clientX:(l=e.touches)==null?void 0:l[0].clientX,s=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},G1=(e,t,n,r,s)=>{const l=t.querySelectorAll(`.${e}`);return!l||!l.length?null:Array.from(l).map(o=>{const c=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:s,position:o.getAttribute("data-handlepos"),x:(c.left-n.left)/r,y:(c.top-n.top)/r,...Im(o)}})};function oE({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:l,targetControlX:o,targetControlY:c}){const f=e*.125+s*.375+o*.375+n*.125,d=t*.125+l*.375+c*.375+r*.125,p=Math.abs(f-e),g=Math.abs(d-t);return[f,d,p,g]}function Ju(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Z1({pos:e,x1:t,y1:n,x2:r,y2:s,c:l}){switch(e){case Ce.Left:return[t-Ju(t-r,l),n];case Ce.Right:return[t+Ju(r-t,l),n];case Ce.Top:return[t,n-Ju(n-s,l)];case Ce.Bottom:return[t,n+Ju(s-n,l)]}}function uE({sourceX:e,sourceY:t,sourcePosition:n=Ce.Bottom,targetX:r,targetY:s,targetPosition:l=Ce.Top,curvature:o=.25}){const[c,f]=Z1({pos:n,x1:e,y1:t,x2:r,y2:s,c:o}),[d,p]=Z1({pos:l,x1:r,y1:s,x2:e,y2:t,c:o}),[g,m,b,x]=oE({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:c,sourceControlY:f,targetControlX:d,targetControlY:p});return[`M${e},${t} C${c},${f} ${d},${p} ${r},${s}`,g,m,b,x]}function cE({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,l=n<e?n+s:n-s,o=Math.abs(r-t)/2,c=r<t?r+o:r-o;return[l,c,s,o]}function e8({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:s=!1}){if(!s)return r;const l=n||t.selected||e.selected,o=Math.max(e.internals.z||0,t.internals.z||0,1e3);return r+(l?o:0)}function t8({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const l=ef(Mc(e),Mc(t));l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const o={x:-s[0]/s[2],y:-s[1]/s[2],width:n/s[2],height:r/s[2]};return ro(o,tf(l))>0}const n8=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,r8=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),i8=(e,t)=>{if(!e.source||!e.target)return t;let n;return Kk(e)?n={...e}:n={...e,id:n8(e)},r8(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function fE({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,l,o,c]=cE({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,l,o,c]}const Y1={[Ce.Left]:{x:-1,y:0},[Ce.Right]:{x:1,y:0},[Ce.Top]:{x:0,y:-1},[Ce.Bottom]:{x:0,y:1}},a8=({source:e,sourcePosition:t=Ce.Bottom,target:n})=>t===Ce.Left||t===Ce.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},X1=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function s8({source:e,sourcePosition:t=Ce.Bottom,target:n,targetPosition:r=Ce.Top,center:s,offset:l}){const o=Y1[t],c=Y1[r],f={x:e.x+o.x*l,y:e.y+o.y*l},d={x:n.x+c.x*l,y:n.y+c.y*l},p=a8({source:f,sourcePosition:t,target:d}),g=p.x!==0?"x":"y",m=p[g];let b=[],x,w;const _={x:0,y:0},k={x:0,y:0},[A,S,O,D]=cE({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[g]*c[g]===-1){x=s.x??A,w=s.y??S;const F=[{x,y:f.y},{x,y:d.y}],L=[{x:f.x,y:w},{x:d.x,y:w}];o[g]===m?b=g==="x"?F:L:b=g==="x"?L:F}else{const F=[{x:f.x,y:d.y}],L=[{x:d.x,y:f.y}];if(g==="x"?b=o.x===m?L:F:b=o.y===m?F:L,t===r){const q=Math.abs(e[g]-n[g]);if(q<=l){const R=Math.min(l-1,l-q);o[g]===m?_[g]=(f[g]>e[g]?-1:1)*R:k[g]=(d[g]>n[g]?-1:1)*R}}if(t!==r){const q=g==="x"?"y":"x",R=o[g]===c[q],$=f[q]>d[q],I=f[q]<d[q];(o[g]===1&&(!R&&$||R&&I)||o[g]!==1&&(!R&&I||R&&$))&&(b=g==="x"?F:L)}const U={x:f.x+_.x,y:f.y+_.y},j={x:d.x+k.x,y:d.y+k.y},H=Math.max(Math.abs(U.x-b[0].x),Math.abs(j.x-b[0].x)),B=Math.max(Math.abs(U.y-b[0].y),Math.abs(j.y-b[0].y));H>=B?(x=(U.x+j.x)/2,w=b[0].y):(x=b[0].x,w=(U.y+j.y)/2)}return[[e,{x:f.x+_.x,y:f.y+_.y},...b,{x:d.x+k.x,y:d.y+k.y},n],x,w,O,D]}function l8(e,t,n,r){const s=Math.min(X1(e,t)/2,X1(t,n)/2,r),{x:l,y:o}=t;if(e.x===l&&l===n.x||e.y===o&&o===n.y)return`L${l} ${o}`;if(e.y===o){const d=e.x<n.x?-1:1,p=e.y<n.y?1:-1;return`L ${l+s*d},${o}Q ${l},${o} ${l},${o+s*p}`}const c=e.x<n.x?1:-1,f=e.y<n.y?-1:1;return`L ${l},${o+s*f}Q ${l},${o} ${l+s*c},${o}`}function Kg({sourceX:e,sourceY:t,sourcePosition:n=Ce.Bottom,targetX:r,targetY:s,targetPosition:l=Ce.Top,borderRadius:o=5,centerX:c,centerY:f,offset:d=20}){const[p,g,m,b,x]=s8({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:l,center:{x:c,y:f},offset:d});return[p.reduce((_,k,A)=>{let S="";return A>0&&A<p.length-1?S=l8(p[A-1],k,p[A+1],o):S=`${A===0?"M":"L"}${k.x} ${k.y}`,_+=S,_},""),g,m,b,x]}function Q1(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function o8(e){var g;const{sourceNode:t,targetNode:n}=e;if(!Q1(t)||!Q1(n))return null;const r=t.internals.handleBounds||K1(t.handles),s=n.internals.handleBounds||K1(n.handles),l=J1((r==null?void 0:r.source)??[],e.sourceHandle),o=J1(e.connectionMode===gs.Strict?(s==null?void 0:s.target)??[]:((s==null?void 0:s.target)??[]).concat((s==null?void 0:s.source)??[]),e.targetHandle);if(!l||!o)return(g=e.onError)==null||g.call(e,"008",or.error008(l?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(l==null?void 0:l.position)||Ce.Bottom,f=(o==null?void 0:o.position)||Ce.Top,d=io(t,l,c),p=io(n,o,f);return{sourceX:d.x,sourceY:d.y,targetX:p.x,targetY:p.y,sourcePosition:c,targetPosition:f}}function K1(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function io(e,t,n=Ce.Left,r=!1){const s=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,l=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:c}=t??Ir(e);if(r)return{x:s+o/2,y:l+c/2};switch((t==null?void 0:t.position)??n){case Ce.Top:return{x:s+o/2,y:l};case Ce.Right:return{x:s+o,y:l+c/2};case Ce.Bottom:return{x:s+o/2,y:l+c};case Ce.Left:return{x:s,y:l+c/2}}}function J1(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Jg(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function u8(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const l=new Set;return e.reduce((o,c)=>([c.markerStart||r,c.markerEnd||s].forEach(f=>{if(f&&typeof f=="object"){const d=Jg(f,t);l.has(d)||(o.push({id:d,color:f.color||n,...f}),l.add(d))}}),o),[]).sort((o,c)=>o.id.localeCompare(c.id))}const Bm={nodeOrigin:[0,0],nodeExtent:to,elevateNodesOnSelect:!0,defaults:{}},c8={...Bm,checkEquality:!0};function Fm(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function f8(e,t,n){const r=Fm(Bm,n);for(const s of e.values())if(s.parentId)Pm(s,e,t,r);else{const l=ho(s,r.nodeOrigin),o=bs(s.extent)?s.extent:r.nodeExtent,c=sa(l,o,Ir(s));s.internals.positionAbsolute=c}}function Wg(e,t,n,r){var f,d;const s=Fm(c8,r);let l=e.length>0;const o=new Map(t),c=s!=null&&s.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const p of e){let g=o.get(p.id);if(s.checkEquality&&p===(g==null?void 0:g.internals.userNode))t.set(p.id,g);else{const m=ho(p,s.nodeOrigin),b=bs(p.extent)?p.extent:s.nodeExtent,x=sa(m,b,Ir(p));g={...s.defaults,...p,measured:{width:(f=p.measured)==null?void 0:f.width,height:(d=p.measured)==null?void 0:d.height},internals:{positionAbsolute:x,handleBounds:p.measured?g==null?void 0:g.internals.handleBounds:void 0,z:dE(p,c),userNode:p}},t.set(p.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(l=!1),p.parentId&&Pm(g,t,n,r)}return l}function d8(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Pm(e,t,n,r){const{elevateNodesOnSelect:s,nodeOrigin:l,nodeExtent:o}=Fm(Bm,r),c=e.parentId,f=t.get(c);if(!f){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}d8(e,n);const d=s?1e3:0,{x:p,y:g,z:m}=h8(e,f,l,o,d),{positionAbsolute:b}=e.internals,x=p!==b.x||g!==b.y;(x||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:p,y:g}:b,z:m}})}function dE(e,t){return(qn(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function h8(e,t,n,r,s){const{x:l,y:o}=t.internals.positionAbsolute,c=Ir(e),f=ho(e,n),d=bs(e.extent)?sa(f,e.extent,c):f;let p=sa({x:l+d.x,y:o+d.y},r,c);e.extent==="parent"&&(p=eE(p,c,t));const g=dE(e,s),m=t.internals.z??0;return{x:p.x,y:p.y,z:m>g?m:g}}function Um(e,t,n,r=[0,0]){var o;const s=[],l=new Map;for(const c of e){const f=t.get(c.parentId);if(!f)continue;const d=((o=l.get(c.parentId))==null?void 0:o.expandedRect)??ys(f),p=nE(d,c.rect);l.set(c.parentId,{expandedRect:p,parent:f})}return l.size>0&&l.forEach(({expandedRect:c,parent:f},d)=>{var S;const p=f.internals.positionAbsolute,g=Ir(f),m=f.origin??r,b=c.x<p.x?Math.round(Math.abs(p.x-c.x)):0,x=c.y<p.y?Math.round(Math.abs(p.y-c.y)):0,w=Math.max(g.width,Math.round(c.width)),_=Math.max(g.height,Math.round(c.height)),k=(w-g.width)*m[0],A=(_-g.height)*m[1];(b>0||x>0||k||A)&&(s.push({id:d,type:"position",position:{x:f.position.x-b+k,y:f.position.y-x+A}}),(S=n.get(d))==null||S.forEach(O=>{e.some(D=>D.id===O.id)||s.push({id:O.id,type:"position",position:{x:O.position.x+b,y:O.position.y+x}})})),(g.width<c.width||g.height<c.height||b||x)&&s.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:w+(b?m[0]*b-k:0),height:_+(x?m[1]*x-A:0)}})}),s}function p8(e,t,n,r,s,l){const o=r==null?void 0:r.querySelector(".xyflow__viewport");let c=!1;if(!o)return{changes:[],updatedInternals:c};const f=[],d=window.getComputedStyle(o),{m22:p}=new window.DOMMatrixReadOnly(d.transform),g=[];for(const m of e.values()){const b=t.get(m.id);if(!b)continue;if(b.hidden){t.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),c=!0;continue}const x=Im(m.nodeElement),w=b.measured.width!==x.width||b.measured.height!==x.height;if(!!(x.width&&x.height&&(w||!b.internals.handleBounds||m.force))){const k=m.nodeElement.getBoundingClientRect(),A=bs(b.extent)?b.extent:l;let{positionAbsolute:S}=b.internals;b.parentId&&b.extent==="parent"?S=eE(S,x,t.get(b.parentId)):A&&(S=sa(S,A,x));const O={...b,measured:x,internals:{...b.internals,positionAbsolute:S,handleBounds:{source:G1("source",m.nodeElement,k,p,b.id),target:G1("target",m.nodeElement,k,p,b.id)}}};t.set(b.id,O),b.parentId&&Pm(O,t,n,{nodeOrigin:s}),c=!0,w&&(f.push({id:b.id,type:"dimensions",dimensions:x}),b.expandParent&&b.parentId&&g.push({id:b.id,parentId:b.parentId,rect:ys(O,s)}))}}if(g.length>0){const m=Um(g,t,n,s);f.push(...m)}return{changes:f,updatedInternals:c}}async function g8({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:l}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,l]],r),c=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(c)}function W1(e,t,n,r,s,l){let o=s;const c=r.get(o)||new Map;r.set(o,c.set(n,t)),o=`${s}-${e}`;const f=r.get(o)||new Map;if(r.set(o,f.set(n,t)),l){o=`${s}-${e}-${l}`;const d=r.get(o)||new Map;r.set(o,d.set(n,t))}}function hE(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:l,sourceHandle:o=null,targetHandle:c=null}=r,f={edgeId:r.id,source:s,target:l,sourceHandle:o,targetHandle:c},d=`${s}-${o}--${l}-${c}`,p=`${l}-${c}--${s}-${o}`;W1("source",f,p,e,s,o),W1("target",f,d,e,l,c),t.set(r.id,r)}}function pE(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:pE(n,t):!1}function ew(e,t,n){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function m8(e,t,n,r){const s=new Map;for(const[l,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!pE(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const c=e.get(l);c&&s.set(l,{id:l,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return s}function dp({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,c,f;const s=[];for(const[d,p]of t){const g=(o=n.get(d))==null?void 0:o.internals.userNode;g&&s.push({...g,position:p.position,dragging:r})}if(!e)return[s[0],s];const l=(c=n.get(e))==null?void 0:c.internals.userNode;return[l?{...l,position:((f=t.get(e))==null?void 0:f.position)||l.position,dragging:r}:s[0],s]}function y8({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let l={x:null,y:null},o=0,c=new Map,f=!1,d={x:0,y:0},p=null,g=!1,m=null,b=!1;function x({noDragClassName:_,handleSelector:k,domNode:A,isSelectable:S,nodeId:O,nodeClickDistance:D=0}){m=vn(A);function M({x:j,y:H},B){const{nodeLookup:q,nodeExtent:R,snapGrid:$,snapToGrid:I,nodeOrigin:P,onNodeDrag:Y,onSelectionDrag:X,onError:E,updateNodePositions:G}=t();l={x:j,y:H};let te=!1,T={x:0,y:0,x2:0,y2:0};if(c.size>1&&R){const V=po(c);T=Qg(V)}for(const[V,K]of c){if(!q.has(V))continue;let J={x:j-K.distance.x,y:H-K.distance.y};I&&(J=nf(J,$));let le=[[R[0][0],R[0][1]],[R[1][0],R[1][1]]];if(c.size>1&&R&&!K.extent){const{positionAbsolute:Ae}=K.internals,Se=Ae.x-T.x+R[0][0],be=Ae.x+K.measured.width-T.x2+R[1][0],je=Ae.y-T.y+R[0][1],ze=Ae.y+K.measured.height-T.y2+R[1][1];le=[[Se,je],[be,ze]]}const{position:fe,positionAbsolute:ye}=Wk({nodeId:V,nextPosition:J,nodeLookup:q,nodeExtent:le,nodeOrigin:P,onError:E});te=te||K.position.x!==fe.x||K.position.y!==fe.y,K.position=fe,K.internals.positionAbsolute=ye}if(te&&(G(c,!0),B&&(r||Y||!O&&X))){const[V,K]=dp({nodeId:O,dragItems:c,nodeLookup:q});r==null||r(B,c,V,K),Y==null||Y(B,V,K),O||X==null||X(B,K)}}async function F(){if(!p)return;const{transform:j,panBy:H,autoPanSpeed:B,autoPanOnNodeDrag:q}=t();if(!q){f=!1,cancelAnimationFrame(o);return}const[R,$]=tE(d,p,B);(R!==0||$!==0)&&(l.x=(l.x??0)-R/j[2],l.y=(l.y??0)-$/j[2],await H({x:R,y:$})&&M(l,null)),o=requestAnimationFrame(F)}function L(j){var te;const{nodeLookup:H,multiSelectionActive:B,nodesDraggable:q,transform:R,snapGrid:$,snapToGrid:I,selectNodesOnDrag:P,onNodeDragStart:Y,onSelectionDragStart:X,unselectNodesAndEdges:E}=t();g=!0,(!P||!S)&&!B&&O&&((te=H.get(O))!=null&&te.selected||E()),S&&P&&O&&(e==null||e(O));const G=Hl(j.sourceEvent,{transform:R,snapGrid:$,snapToGrid:I,containerBounds:p});if(l=G,c=m8(H,q,G,O),c.size>0&&(n||Y||!O&&X)){const[T,V]=dp({nodeId:O,dragItems:c,nodeLookup:H});n==null||n(j.sourceEvent,c,T,V),Y==null||Y(j.sourceEvent,T,V),O||X==null||X(j.sourceEvent,V)}}const U=Rk().clickDistance(D).on("start",j=>{const{domNode:H,nodeDragThreshold:B,transform:q,snapGrid:R,snapToGrid:$}=t();p=(H==null?void 0:H.getBoundingClientRect())||null,b=!1,B===0&&L(j),l=Hl(j.sourceEvent,{transform:q,snapGrid:R,snapToGrid:$,containerBounds:p}),d=Dr(j.sourceEvent,p)}).on("drag",j=>{const{autoPanOnNodeDrag:H,transform:B,snapGrid:q,snapToGrid:R,nodeDragThreshold:$,nodeLookup:I}=t(),P=Hl(j.sourceEvent,{transform:B,snapGrid:q,snapToGrid:R,containerBounds:p});if((j.sourceEvent.type==="touchmove"&&j.sourceEvent.touches.length>1||O&&!I.has(O))&&(b=!0),!b){if(!f&&H&&g&&(f=!0,F()),!g){const Y=P.xSnapped-(l.x??0),X=P.ySnapped-(l.y??0);Math.sqrt(Y*Y+X*X)>$&&L(j)}(l.x!==P.xSnapped||l.y!==P.ySnapped)&&c&&g&&(d=Dr(j.sourceEvent,p),M(P,j.sourceEvent))}}).on("end",j=>{if(!(!g||b)&&(f=!1,g=!1,cancelAnimationFrame(o),c.size>0)){const{nodeLookup:H,updateNodePositions:B,onNodeDragStop:q,onSelectionDragStop:R}=t();if(B(c,!1),s||q||!O&&R){const[$,I]=dp({nodeId:O,dragItems:c,nodeLookup:H,dragging:!1});s==null||s(j.sourceEvent,c,$,I),q==null||q(j.sourceEvent,$,I),O||R==null||R(j.sourceEvent,I)}}}).filter(j=>{const H=j.target;return!j.button&&(!_||!ew(H,`.${_}`,A))&&(!k||ew(H,k,A))});m.call(U)}function w(){m==null||m.on(".drag",null)}return{update:x,destroy:w}}function b8(e,t,n){const r=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const l of t.values())ro(s,ys(l))>0&&r.push(l);return r}const v8=250;function x8(e,t,n,r){var c,f;let s=[],l=1/0;const o=b8(e,n,t+v8);for(const d of o){const p=[...((c=d.internals.handleBounds)==null?void 0:c.source)??[],...((f=d.internals.handleBounds)==null?void 0:f.target)??[]];for(const g of p){if(r.nodeId===g.nodeId&&r.type===g.type&&r.id===g.id)continue;const{x:m,y:b}=io(d,g,g.position,!0),x=Math.sqrt(Math.pow(m-e.x,2)+Math.pow(b-e.y,2));x>t||(x<l?(s=[{...g,x:m,y:b}],l=x):x===l&&s.push({...g,x:m,y:b}))}}if(!s.length)return null;if(s.length>1){const d=r.type==="source"?"target":"source";return s.find(p=>p.type===d)??s[0]}return s[0]}function gE(e,t,n,r,s,l=!1){var d,p,g;const o=r.get(e);if(!o)return null;const c=s==="strict"?(d=o.internals.handleBounds)==null?void 0:d[t]:[...((p=o.internals.handleBounds)==null?void 0:p.source)??[],...((g=o.internals.handleBounds)==null?void 0:g.target)??[]],f=(n?c==null?void 0:c.find(m=>m.id===n):c==null?void 0:c[0])??null;return f&&l?{...f,...io(o,f,f.position,!0)}:f}function mE(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function w8(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const yE=()=>!0;function _8(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:l,isTarget:o,domNode:c,nodeLookup:f,lib:d,autoPanOnConnect:p,flowId:g,panBy:m,cancelConnection:b,onConnectStart:x,onConnect:w,onConnectEnd:_,isValidConnection:k=yE,onReconnectEnd:A,updateConnection:S,getTransform:O,getFromHandle:D,autoPanSpeed:M}){const F=aE(e.target);let L=0,U;const{x:j,y:H}=Dr(e),B=F==null?void 0:F.elementFromPoint(j,H),q=mE(l,B),R=c==null?void 0:c.getBoundingClientRect();if(!R||!q)return;const $=gE(s,q,r,f,t);if(!$)return;let I=Dr(e,R),P=!1,Y=null,X=!1,E=null;function G(){if(!p||!R)return;const[ye,Ae]=tE(I,R,M);m({x:ye,y:Ae}),L=requestAnimationFrame(G)}const te={...$,nodeId:s,type:q,position:$.position},T=f.get(s),K={inProgress:!0,isValid:null,from:io(T,te,Ce.Left,!0),fromHandle:te,fromPosition:te.position,fromNode:T,to:I,toHandle:null,toPosition:H1[te.position],toNode:null};S(K);let J=K;x==null||x(e,{nodeId:s,handleId:r,handleType:q});function le(ye){if(!D()||!te){fe(ye);return}const Ae=O();I=Dr(ye,R),U=x8(go(I,Ae,!1,[1,1]),n,f,te),P||(G(),P=!0);const Se=bE(ye,{handle:U,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:o?"target":"source",isValidConnection:k,doc:F,lib:d,flowId:g,nodeLookup:f});E=Se.handleDomNode,Y=Se.connection,X=w8(!!U,Se.isValid);const be={...J,isValid:X,to:Se.toHandle&&X?Rc({x:Se.toHandle.x,y:Se.toHandle.y},Ae):I,toHandle:Se.toHandle,toPosition:X&&Se.toHandle?Se.toHandle.position:H1[te.position],toNode:Se.toHandle?f.get(Se.toHandle.nodeId):null};X&&U&&J.toHandle&&be.toHandle&&J.toHandle.type===be.toHandle.type&&J.toHandle.nodeId===be.toHandle.nodeId&&J.toHandle.id===be.toHandle.id&&J.to.x===be.to.x&&J.to.y===be.to.y||(S(be),J=be)}function fe(ye){(U||E)&&Y&&X&&(w==null||w(Y));const{inProgress:Ae,...Se}=J,be={...Se,toPosition:J.toHandle?J.toPosition:null};_==null||_(ye,be),l&&(A==null||A(ye,be)),b(),cancelAnimationFrame(L),P=!1,X=!1,Y=null,E=null,F.removeEventListener("mousemove",le),F.removeEventListener("mouseup",fe),F.removeEventListener("touchmove",le),F.removeEventListener("touchend",fe)}F.addEventListener("mousemove",le),F.addEventListener("mouseup",fe),F.addEventListener("touchmove",le),F.addEventListener("touchend",fe)}function bE(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:l,doc:o,lib:c,flowId:f,isValidConnection:d=yE,nodeLookup:p}){const g=l==="target",m=t?o.querySelector(`.${c}-flow__handle[data-id="${f}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:b,y:x}=Dr(e),w=o.elementFromPoint(b,x),_=w!=null&&w.classList.contains(`${c}-flow__handle`)?w:m,k={handleDomNode:_,isValid:!1,connection:null,toHandle:null};if(_){const A=mE(void 0,_),S=_.getAttribute("data-nodeid"),O=_.getAttribute("data-handleid"),D=_.classList.contains("connectable"),M=_.classList.contains("connectableend");if(!S||!A)return k;const F={source:g?S:r,sourceHandle:g?O:s,target:g?r:S,targetHandle:g?s:O};k.connection=F;const U=D&&M&&(n===gs.Strict?g&&A==="source"||!g&&A==="target":S!==r||O!==s);k.isValid=U&&d(F),k.toHandle=gE(S,A,O,p,n,!0)}return k}const em={onPointerDown:_8,isValid:bE};function S8({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=vn(e);function l({translateExtent:c,width:f,height:d,zoomStep:p=10,pannable:g=!0,zoomable:m=!0,inversePan:b=!1}){const x=S=>{const O=n();if(S.sourceEvent.type!=="wheel"||!t)return;const D=-S.sourceEvent.deltaY*(S.sourceEvent.deltaMode===1?.05:S.sourceEvent.deltaMode?1:.002)*p,M=O[2]*Math.pow(2,D);t.scaleTo(M)};let w=[0,0];const _=S=>{(S.sourceEvent.type==="mousedown"||S.sourceEvent.type==="touchstart")&&(w=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY])},k=S=>{const O=n();if(S.sourceEvent.type!=="mousemove"&&S.sourceEvent.type!=="touchmove"||!t)return;const D=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY],M=[D[0]-w[0],D[1]-w[1]];w=D;const F=r()*Math.max(O[2],Math.log(O[2]))*(b?-1:1),L={x:O[0]-M[0]*F,y:O[1]-M[1]*F},U=[[0,0],[f,d]];t.setViewportConstrained({x:L.x,y:L.y,zoom:O[2]},U,c)},A=Zk().on("start",_).on("zoom",g?k:null).on("zoom.wheel",m?x:null);s.call(A,{})}function o(){s.on("zoom",null)}return{update:l,destroy:o,pointer:$n}}const k8=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,rf=e=>({x:e.x,y:e.y,zoom:e.k}),hp=({x:e,y:t,zoom:n})=>Wc.translate(e,t).scale(n),ts=(e,t)=>e.target.closest(`.${t}`),vE=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),pp=(e,t=0,n=()=>{})=>{const r=typeof t=="number"&&t>0;return r||n(),r?e.transition().duration(t).on("end",n):e},xE=e=>{const t=e.ctrlKey&&Dc()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function E8({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:l,zoomOnPinch:o,onPanZoomStart:c,onPanZoom:f,onPanZoomEnd:d}){return p=>{if(ts(p,t))return!1;p.preventDefault(),p.stopImmediatePropagation();const g=n.property("__zoom").k||1;if(p.ctrlKey&&o){const _=$n(p),k=xE(p),A=g*Math.pow(2,k);r.scaleTo(n,A,_,p);return}const m=p.deltaMode===1?20:1;let b=s===na.Vertical?0:p.deltaX*m,x=s===na.Horizontal?0:p.deltaY*m;!Dc()&&p.shiftKey&&s!==na.Vertical&&(b=p.deltaY*m,x=0),r.translateBy(n,-(b/g)*l,-(x/g)*l,{internal:!0});const w=rf(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,c==null||c(p,w)),e.isPanScrolling&&(f==null||f(p,w),e.panScrollTimeout=setTimeout(()=>{d==null||d(p,w),e.isPanScrolling=!1},150))}}function A8({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const l=r.type==="wheel",o=!t&&l&&!r.ctrlKey,c=ts(r,e);if(r.ctrlKey&&l&&c&&r.preventDefault(),o||c)return null;r.preventDefault(),n.call(this,r,s)}}function T8({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var l,o,c;if((l=r.sourceEvent)!=null&&l.internal)return;const s=rf(r.transform);e.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((c=r.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function N8({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return l=>{var o,c;e.usedRightMouseButton=!!(n&&vE(t,e.mouseButton??0)),(o=l.sourceEvent)!=null&&o.sync||r([l.transform.x,l.transform.y,l.transform.k]),s&&!((c=l.sourceEvent)!=null&&c.internal)&&(s==null||s(l.sourceEvent,rf(l.transform)))}}function C8({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:l}){return o=>{var c;if(!((c=o.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,l&&vE(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&l(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),s&&k8(e.prevViewport,o.transform))){const f=rf(o.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(o.sourceEvent,f)},n?150:0)}}}function O8({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:l,userSelectionActive:o,noWheelClassName:c,noPanClassName:f,lib:d}){return p=>{var x;const g=e||t,m=n&&p.ctrlKey;if(p.button===1&&p.type==="mousedown"&&(ts(p,`${d}-flow__node`)||ts(p,`${d}-flow__edge`)))return!0;if(!r&&!g&&!s&&!l&&!n||o||ts(p,c)&&p.type==="wheel"||ts(p,f)&&(p.type!=="wheel"||s&&p.type==="wheel"&&!e)||!n&&p.ctrlKey&&p.type==="wheel")return!1;if(!n&&p.type==="touchstart"&&((x=p.touches)==null?void 0:x.length)>1)return p.preventDefault(),!1;if(!g&&!s&&!m&&p.type==="wheel"||!r&&(p.type==="mousedown"||p.type==="touchstart")||Array.isArray(r)&&!r.includes(p.button)&&p.type==="mousedown")return!1;const b=Array.isArray(r)&&r.includes(p.button)||!p.button||p.button<=1;return(!p.ctrlKey||p.type==="wheel")&&b}}function M8({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:s,viewport:l,onPanZoom:o,onPanZoomStart:c,onPanZoomEnd:f,onDraggingChange:d}){const p={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=e.getBoundingClientRect(),m=Zk().clickDistance(!qn(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(s),b=vn(e).call(m);S({x:l.x,y:l.y,zoom:ms(l.zoom,t,n)},[[0,0],[g.width,g.height]],s);const x=b.on("wheel.zoom"),w=b.on("dblclick.zoom");m.wheelDelta(xE);function _(B,q){return b?new Promise(R=>{m==null||m.transform(pp(b,q==null?void 0:q.duration,()=>R(!0)),B)}):Promise.resolve(!1)}function k({noWheelClassName:B,noPanClassName:q,onPaneContextMenu:R,userSelectionActive:$,panOnScroll:I,panOnDrag:P,panOnScrollMode:Y,panOnScrollSpeed:X,preventScrolling:E,zoomOnPinch:G,zoomOnScroll:te,zoomOnDoubleClick:T,zoomActivationKeyPressed:V,lib:K,onTransformChange:J}){$&&!p.isZoomingOrPanning&&A();const fe=I&&!V&&!$?E8({zoomPanValues:p,noWheelClassName:B,d3Selection:b,d3Zoom:m,panOnScrollMode:Y,panOnScrollSpeed:X,zoomOnPinch:G,onPanZoomStart:c,onPanZoom:o,onPanZoomEnd:f}):A8({noWheelClassName:B,preventScrolling:E,d3ZoomHandler:x});if(b.on("wheel.zoom",fe,{passive:!1}),!$){const Ae=T8({zoomPanValues:p,onDraggingChange:d,onPanZoomStart:c});m.on("start",Ae);const Se=N8({zoomPanValues:p,panOnDrag:P,onPaneContextMenu:!!R,onPanZoom:o,onTransformChange:J});m.on("zoom",Se);const be=C8({zoomPanValues:p,panOnDrag:P,panOnScroll:I,onPaneContextMenu:R,onPanZoomEnd:f,onDraggingChange:d});m.on("end",be)}const ye=O8({zoomActivationKeyPressed:V,panOnDrag:P,zoomOnScroll:te,panOnScroll:I,zoomOnDoubleClick:T,zoomOnPinch:G,userSelectionActive:$,noPanClassName:q,noWheelClassName:B,lib:K});m.filter(ye),T?b.on("dblclick.zoom",w):b.on("dblclick.zoom",null)}function A(){m.on("zoom",null)}async function S(B,q,R){const $=hp(B),I=m==null?void 0:m.constrain()($,q,R);return I&&await _(I),new Promise(P=>P(I))}async function O(B,q){const R=hp(B);return await _(R,q),new Promise($=>$(R))}function D(B){if(b){const q=hp(B),R=b.property("__zoom");(R.k!==B.zoom||R.x!==B.x||R.y!==B.y)&&(m==null||m.transform(b,q,null,{sync:!0}))}}function M(){const B=b?Gk(b.node()):{x:0,y:0,k:1};return{x:B.x,y:B.y,zoom:B.k}}function F(B,q){return b?new Promise(R=>{m==null||m.scaleTo(pp(b,q==null?void 0:q.duration,()=>R(!0)),B)}):Promise.resolve(!1)}function L(B,q){return b?new Promise(R=>{m==null||m.scaleBy(pp(b,q==null?void 0:q.duration,()=>R(!0)),B)}):Promise.resolve(!1)}function U(B){m==null||m.scaleExtent(B)}function j(B){m==null||m.translateExtent(B)}function H(B){const q=!qn(B)||B<0?0:B;m==null||m.clickDistance(q)}return{update:k,destroy:A,setViewport:O,setViewportConstrained:S,getViewport:M,scaleTo:F,scaleBy:L,setScaleExtent:U,setTranslateExtent:j,syncViewport:D,setClickDistance:H}}var $l;(function(e){e.Line="line",e.Handle="handle"})($l||($l={}));function R8({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:l}){const o=e-t,c=n-r,f=[o>0?1:o<0?-1:0,c>0?1:c<0?-1:0];return o&&s&&(f[0]=f[0]*-1),c&&l&&(f[1]=f[1]*-1),f}function D8(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:s}}function pi(e,t){return Math.max(0,t-e)}function gi(e,t){return Math.max(0,e-t)}function Wu(e,t,n){return Math.max(0,t-e,e-n)}function tw(e,t){return e?!t:t}function j8(e,t,n,r,s,l,o,c){let{affectsX:f,affectsY:d}=t;const{isHorizontal:p,isVertical:g}=t,m=p&&g,{xSnapped:b,ySnapped:x}=n,{minWidth:w,maxWidth:_,minHeight:k,maxHeight:A}=r,{x:S,y:O,width:D,height:M,aspectRatio:F}=e;let L=Math.floor(p?b-e.pointerX:0),U=Math.floor(g?x-e.pointerY:0);const j=D+(f?-L:L),H=M+(d?-U:U),B=-l[0]*D,q=-l[1]*M;let R=Wu(j,w,_),$=Wu(H,k,A);if(o){let Y=0,X=0;f&&L<0?Y=pi(S+L+B,o[0][0]):!f&&L>0&&(Y=gi(S+j+B,o[1][0])),d&&U<0?X=pi(O+U+q,o[0][1]):!d&&U>0&&(X=gi(O+H+q,o[1][1])),R=Math.max(R,Y),$=Math.max($,X)}if(c){let Y=0,X=0;f&&L>0?Y=gi(S+L,c[0][0]):!f&&L<0&&(Y=pi(S+j,c[1][0])),d&&U>0?X=gi(O+U,c[0][1]):!d&&U<0&&(X=pi(O+H,c[1][1])),R=Math.max(R,Y),$=Math.max($,X)}if(s){if(p){const Y=Wu(j/F,k,A)*F;if(R=Math.max(R,Y),o){let X=0;!f&&!d||f&&!d&&m?X=gi(O+q+j/F,o[1][1])*F:X=pi(O+q+(f?L:-L)/F,o[0][1])*F,R=Math.max(R,X)}if(c){let X=0;!f&&!d||f&&!d&&m?X=pi(O+j/F,c[1][1])*F:X=gi(O+(f?L:-L)/F,c[0][1])*F,R=Math.max(R,X)}}if(g){const Y=Wu(H*F,w,_)/F;if($=Math.max($,Y),o){let X=0;!f&&!d||d&&!f&&m?X=gi(S+H*F+B,o[1][0])/F:X=pi(S+(d?U:-U)*F+B,o[0][0])/F,$=Math.max($,X)}if(c){let X=0;!f&&!d||d&&!f&&m?X=pi(S+H*F,c[1][0])/F:X=gi(S+(d?U:-U)*F,c[0][0])/F,$=Math.max($,X)}}}U=U+(U<0?$:-$),L=L+(L<0?R:-R),s&&(m?j>H*F?U=(tw(f,d)?-L:L)/F:L=(tw(f,d)?-U:U)*F:p?(U=L/F,d=f):(L=U*F,f=d));const I=f?S+L:S,P=d?O+U:O;return{width:D+(f?-L:L),height:M+(d?-U:U),x:l[0]*L*(f?-1:1)+I,y:l[1]*U*(d?-1:1)+P}}const wE={width:0,height:0,x:0,y:0},z8={...wE,pointerX:0,pointerY:0,aspectRatio:1};function L8(e){return[[0,0],[e.measured.width,e.measured.height]]}function I8(e,t,n){const r=t.position.x+e.position.x,s=t.position.y+e.position.y,l=e.measured.width??0,o=e.measured.height??0,c=n[0]*l,f=n[1]*o;return[[r-c,s-f],[r+l-c,s+o-f]]}function B8({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const l=vn(e);function o({controlPosition:f,boundaries:d,keepAspectRatio:p,resizeDirection:g,onResizeStart:m,onResize:b,onResizeEnd:x,shouldResize:w}){let _={...wE},k={...z8};const A=D8(f);let S,O=null,D=[],M,F,L;const U=Rk().on("start",j=>{const{nodeLookup:H,transform:B,snapGrid:q,snapToGrid:R,nodeOrigin:$,paneDomNode:I}=n();if(S=H.get(t),!S)return;O=(I==null?void 0:I.getBoundingClientRect())??null;const{xSnapped:P,ySnapped:Y}=Hl(j.sourceEvent,{transform:B,snapGrid:q,snapToGrid:R,containerBounds:O});_={width:S.measured.width??0,height:S.measured.height??0,x:S.position.x??0,y:S.position.y??0},k={..._,pointerX:P,pointerY:Y,aspectRatio:_.width/_.height},M=void 0,S.parentId&&(S.extent==="parent"||S.expandParent)&&(M=H.get(S.parentId),F=M&&S.extent==="parent"?L8(M):void 0),D=[],L=void 0;for(const[X,E]of H)if(E.parentId===t&&(D.push({id:X,position:{...E.position},extent:E.extent}),E.extent==="parent"||E.expandParent)){const G=I8(E,S,E.origin??$);L?L=[[Math.min(G[0][0],L[0][0]),Math.min(G[0][1],L[0][1])],[Math.max(G[1][0],L[1][0]),Math.max(G[1][1],L[1][1])]]:L=G}m==null||m(j,{..._})}).on("drag",j=>{const{transform:H,snapGrid:B,snapToGrid:q,nodeOrigin:R}=n(),$=Hl(j.sourceEvent,{transform:H,snapGrid:B,snapToGrid:q,containerBounds:O}),I=[];if(!S)return;const{x:P,y:Y,width:X,height:E}=_,G={},te=S.origin??R,{width:T,height:V,x:K,y:J}=j8(k,A,$,d,p,te,F,L),le=T!==X,fe=V!==E,ye=K!==P&&le,Ae=J!==Y&&fe;if(!ye&&!Ae&&!le&&!fe)return;if((ye||Ae||te[0]===1||te[1]===1)&&(G.x=ye?K:_.x,G.y=Ae?J:_.y,_.x=G.x,_.y=G.y,D.length>0)){const ze=K-P,lt=J-Y;for(const ft of D)ft.position={x:ft.position.x-ze+te[0]*(T-X),y:ft.position.y-lt+te[1]*(V-E)},I.push(ft)}if((le||fe)&&(G.width=le&&(!g||g==="horizontal")?T:_.width,G.height=fe&&(!g||g==="vertical")?V:_.height,_.width=G.width,_.height=G.height),M&&S.expandParent){const ze=te[0]*(G.width??0);G.x&&G.x<ze&&(_.x=ze,k.x=k.x-(G.x-ze));const lt=te[1]*(G.height??0);G.y&&G.y<lt&&(_.y=lt,k.y=k.y-(G.y-lt))}const Se=R8({width:_.width,prevWidth:X,height:_.height,prevHeight:E,affectsX:A.affectsX,affectsY:A.affectsY}),be={..._,direction:Se};(w==null?void 0:w(j,be))!==!1&&(b==null||b(j,be),r(G,I))}).on("end",j=>{x==null||x(j,{..._}),s==null||s({..._})});l.call(U)}function c(){l.on(".drag",null)}return{update:o,destroy:c}}var gp={exports:{}},mp={},yp={exports:{}},bp={};/**
|
|
223
223
|
* @license React
|
|
224
224
|
* use-sync-external-store-shim.production.js
|
|
225
225
|
*
|
|
@@ -227,7 +227,7 @@ prismjs/prism.js:
|
|
|
227
227
|
*
|
|
228
228
|
* This source code is licensed under the MIT license found in the
|
|
229
229
|
* LICENSE file in the root directory of this source tree.
|
|
230
|
-
*/var
|
|
230
|
+
*/var nw;function F8(){if(nw)return bp;nw=1;var e=so();function t(g,m){return g===m&&(g!==0||1/g===1/m)||g!==g&&m!==m}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,l=e.useLayoutEffect,o=e.useDebugValue;function c(g,m){var b=m(),x=r({inst:{value:b,getSnapshot:m}}),w=x[0].inst,_=x[1];return l(function(){w.value=b,w.getSnapshot=m,f(w)&&_({inst:w})},[g,b,m]),s(function(){return f(w)&&_({inst:w}),g(function(){f(w)&&_({inst:w})})},[g]),o(b),b}function f(g){var m=g.getSnapshot;g=g.value;try{var b=m();return!n(g,b)}catch{return!0}}function d(g,m){return m()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return bp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,bp}var rw;function P8(){return rw||(rw=1,yp.exports=F8()),yp.exports}/**
|
|
231
231
|
* @license React
|
|
232
232
|
* use-sync-external-store-shim/with-selector.production.js
|
|
233
233
|
*
|
|
@@ -235,14 +235,14 @@ prismjs/prism.js:
|
|
|
235
235
|
*
|
|
236
236
|
* This source code is licensed under the MIT license found in the
|
|
237
237
|
* LICENSE file in the root directory of this source tree.
|
|
238
|
-
*/var
|
|
238
|
+
*/var iw;function U8(){if(iw)return mp;iw=1;var e=so(),t=P8();function n(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,l=e.useRef,o=e.useEffect,c=e.useMemo,f=e.useDebugValue;return mp.useSyncExternalStoreWithSelector=function(d,p,g,m,b){var x=l(null);if(x.current===null){var w={hasValue:!1,value:null};x.current=w}else w=x.current;x=c(function(){function k(M){if(!A){if(A=!0,S=M,M=m(M),b!==void 0&&w.hasValue){var F=w.value;if(b(F,M))return O=F}return O=M}if(F=O,r(S,M))return F;var L=m(M);return b!==void 0&&b(F,L)?(S=M,F):(S=M,O=L)}var A=!1,S,O,D=g===void 0?null:g;return[function(){return k(p())},D===null?void 0:function(){return k(D())}]},[p,g,m,b]);var _=s(d,x[0],x[1]);return o(function(){w.hasValue=!0,w.value=_},[_]),f(_),_},mp}var aw;function H8(){return aw||(aw=1,gp.exports=U8()),gp.exports}var $8=H8();const V8=ki($8),q8={},sw=e=>{let t;const n=new Set,r=(p,g)=>{const m=typeof p=="function"?p(t):p;if(!Object.is(m,t)){const b=t;t=g??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(x=>x(t,b))}},s=()=>t,f={setState:r,getState:s,getInitialState:()=>d,subscribe:p=>(n.add(p),()=>n.delete(p)),destroy:()=>{(q8?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(r,s,f);return f},G8=e=>e?sw(e):sw,{useDebugValue:Z8}=DT,{useSyncExternalStoreWithSelector:Y8}=V8,X8=e=>e;function _E(e,t=X8,n){const r=Y8(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Z8(r),r}const lw=(e,t)=>{const n=G8(e),r=(s,l=t)=>_E(n,s,l);return Object.assign(r,n),r},Q8=(e,t)=>e?lw(e,t):lw;function yt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}A_();const af=W.createContext(null),K8=af.Provider,SE=or.error001();function Ge(e,t){const n=W.useContext(af);if(n===null)throw new Error(SE);return _E(n,e,t)}function ht(){const e=W.useContext(af);if(e===null)throw new Error(SE);return W.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const ow={display:"none"},J8={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},kE="react-flow__node-desc",EE="react-flow__edge-desc",W8="react-flow__aria-live",eB=e=>e.ariaLiveMessage;function tB({rfId:e}){const t=Ge(eB);return N.jsx("div",{id:`${W8}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:J8,children:t})}function nB({rfId:e,disableKeyboardA11y:t}){return N.jsxs(N.Fragment,{children:[N.jsxs("div",{id:`${kE}-${e}`,style:ow,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),N.jsx("div",{id:`${EE}-${e}`,style:ow,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&N.jsx(tB,{rfId:e})]})}const rB=e=>e.userSelectionActive?"none":"all",mo=W.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},l)=>{const o=Ge(rB),c=`${e}`.split("-");return N.jsx("div",{className:Nt(["react-flow__panel",n,...c]),style:{...r,pointerEvents:o},ref:l,...s,children:t})});mo.displayName="Panel";function iB({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:N.jsx(mo,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:N.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const aB=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},ec=e=>e.id;function sB(e,t){return yt(e.selectedNodes.map(ec),t.selectedNodes.map(ec))&&yt(e.selectedEdges.map(ec),t.selectedEdges.map(ec))}function lB({onSelectionChange:e}){const t=ht(),{selectedNodes:n,selectedEdges:r}=Ge(aB,sB);return W.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(l=>l(s))},[n,r,e]),null}const oB=e=>!!e.onSelectionChangeHandlers;function uB({onSelectionChange:e}){const t=Ge(oB);return e||t?N.jsx(lB,{onSelectionChange:e}):null}const AE=[0,0],cB={x:0,y:0,zoom:1},fB=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance"],uw=[...fB,"rfId"],dB=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),cw={translateExtent:to,nodeOrigin:AE,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function hB(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:l,setNodeExtent:o,reset:c,setDefaultNodesAndEdges:f,setPaneClickDistance:d}=Ge(dB,yt),p=ht();W.useEffect(()=>(f(e.defaultNodes,e.defaultEdges),()=>{g.current=cw,c()}),[]);const g=W.useRef(cw);return W.useEffect(()=>{for(const m of uw){const b=e[m],x=g.current[m];b!==x&&(typeof e[m]>"u"||(m==="nodes"?t(b):m==="edges"?n(b):m==="minZoom"?r(b):m==="maxZoom"?s(b):m==="translateExtent"?l(b):m==="nodeExtent"?o(b):m==="paneClickDistance"?d(b):m==="fitView"?p.setState({fitViewQueued:b}):m==="fitViewOptions"?p.setState({fitViewOptions:b}):p.setState({[m]:b})))}g.current=e},uw.map(m=>e[m])),null}function fw(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function pB(e){var r;const[t,n]=W.useState(e==="system"?null:e);return W.useEffect(()=>{if(e!=="system"){n(e);return}const s=fw(),l=()=>n(s!=null&&s.matches?"dark":"light");return l(),s==null||s.addEventListener("change",l),()=>{s==null||s.removeEventListener("change",l)}},[e]),t!==null?t:(r=fw())!=null&&r.matches?"dark":"light"}const dw=typeof document<"u"?document:null;function ao(e=null,t={target:dw,actInsideInputWithModifier:!0}){const[n,r]=W.useState(!1),s=W.useRef(!1),l=W.useRef(new Set([])),[o,c]=W.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(g=>typeof g=="string").map(g=>g.replace("+",`
|
|
239
239
|
`).replace(`
|
|
240
240
|
|
|
241
241
|
`,`
|
|
242
242
|
+`).split(`
|
|
243
|
-
`)),p=d.reduce((g,m)=>g.concat(...m),[]);return[d,p]}return[[],[]]},[e]);return W.useEffect(()=>{const f=(t==null?void 0:t.target)??fw,d=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const p=b=>{var _,k;if(s.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!s.current||s.current&&!d)&&sE(b))return!1;const w=hw(b.code,c);if(l.current.add(b[w]),dw(o,l.current,!1)){const A=((k=(_=b.composedPath)==null?void 0:_.call(b))==null?void 0:k[0])||b.target,S=(A==null?void 0:A.nodeName)==="BUTTON"||(A==null?void 0:A.nodeName)==="A";t.preventDefault!==!1&&(s.current||!S)&&b.preventDefault(),r(!0)}},g=b=>{const x=hw(b.code,c);dw(o,l.current,!0)?(r(!1),l.current.clear()):l.current.delete(b[x]),b.key==="Meta"&&l.current.clear(),s.current=!1},m=()=>{l.current.clear(),r(!1)};return f==null||f.addEventListener("keydown",p),f==null||f.addEventListener("keyup",g),window.addEventListener("blur",m),window.addEventListener("contextmenu",m),()=>{f==null||f.removeEventListener("keydown",p),f==null||f.removeEventListener("keyup",g),window.removeEventListener("blur",m),window.removeEventListener("contextmenu",m)}}},[e,r]),n}function dw(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function hw(e,t){return t.includes(e)?"code":"key"}const gB=()=>{const e=ht();return W.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,s,l],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??l},{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>{const{width:s,height:l,maxZoom:o,panZoom:c}=e.getState(),f=typeof(r==null?void 0:r.zoom)<"u"?r.zoom:o,d=s/2-t*f,p=l/2-n*f;return c?(await c.setViewport({x:d,y:p,zoom:f},{duration:r==null?void 0:r.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:r,height:s,minZoom:l,maxZoom:o,panZoom:c}=e.getState(),f=zm(t,r,s,l,o,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(f,{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:s,snapToGrid:l,domNode:o}=e.getState();if(!o)return t;const{x:c,y:f}=o.getBoundingClientRect(),d={x:t.x-c,y:t.y-f},p=n.snapGrid??s,g=n.snapToGrid??l;return go(d,r,g,p)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:l}=r.getBoundingClientRect(),o=Rc(t,n);return{x:o.x+s,y:o.y+l}}}),[])};function TE(e,t){const n=[],r=new Map,s=[];for(const l of e)if(l.type==="add"){s.push(l);continue}else if(l.type==="remove"||l.type==="replace")r.set(l.id,[l]);else{const o=r.get(l.id);o?o.push(l):r.set(l.id,[l])}for(const l of t){const o=r.get(l.id);if(!o){n.push(l);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const c={...l};for(const f of o)mB(f,c);n.push(c)}return s.length&&s.forEach(l=>{l.index!==void 0?n.splice(l.index,0,{...l.item}):n.push({...l.item})}),n}function mB(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??(t.measured={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function CE(e,t){return TE(e,t)}function NE(e,t){return TE(e,t)}function Yi(e,t){return{id:e,type:"select",selected:t}}function ns(e,t=new Set,n=!1){const r=[];for(const[s,l]of e){const o=t.has(s);!(l.selected===void 0&&!o)&&l.selected!==o&&(n&&(l.selected=o),r.push(Yi(l.id,o)))}return r}function pw({items:e=[],lookup:t}){var s;const n=[],r=new Map(e.map(l=>[l.id,l]));for(const[l,o]of e.entries()){const c=t.get(o.id),f=((s=c==null?void 0:c.internals)==null?void 0:s.userNode)??c;f!==void 0&&f!==o&&n.push({id:o.id,item:o,type:"replace"}),f===void 0&&n.push({item:o,type:"add",index:l})}for(const[l]of t)r.get(l)===void 0&&n.push({id:l,type:"remove"});return n}function gw(e){return{id:e.id,type:"remove"}}const mw=e=>$6(e),yB=e=>Kk(e);function OE(e){return W.forwardRef(e)}const bB=typeof window<"u"?W.useLayoutEffect:W.useEffect;function yw(e){const[t,n]=W.useState(BigInt(0)),[r]=W.useState(()=>vB(()=>n(s=>s+BigInt(1))));return bB(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function vB(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const ME=W.createContext(null);function xB({children:e}){const t=ht(),n=W.useCallback(c=>{const{nodes:f=[],setNodes:d,hasDefaultNodes:p,onNodesChange:g,nodeLookup:m,fitViewQueued:b}=t.getState();let x=f;for(const _ of c)x=typeof _=="function"?_(x):_;const w=pw({items:x,lookup:m});p&&d(x),w.length>0?g==null||g(w):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:_,nodes:k,setNodes:A}=t.getState();_&&A(k)})},[]),r=yw(n),s=W.useCallback(c=>{const{edges:f=[],setEdges:d,hasDefaultEdges:p,onEdgesChange:g,edgeLookup:m}=t.getState();let b=f;for(const x of c)b=typeof x=="function"?x(b):x;p?d(b):g&&g(pw({items:b,lookup:m}))},[]),l=yw(s),o=W.useMemo(()=>({nodeQueue:r,edgeQueue:l}),[]);return C.jsx(ME.Provider,{value:o,children:e})}function wB(){const e=W.useContext(ME);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const _B=e=>!!e.panZoom;function sf(){const e=gB(),t=ht(),n=wB(),r=Ge(_B),s=W.useMemo(()=>{const l=g=>t.getState().nodeLookup.get(g),o=g=>{n.nodeQueue.push(g)},c=g=>{n.edgeQueue.push(g)},f=g=>{var k,A;const{nodeLookup:m,nodeOrigin:b}=t.getState(),x=mw(g)?g:m.get(g.id),w=x.parentId?iE(x.position,x.measured,x.parentId,m,b):x.position,_={...x,position:w,width:((k=x.measured)==null?void 0:k.width)??x.width,height:((A=x.measured)==null?void 0:A.height)??x.height};return ys(_)},d=(g,m,b={replace:!1})=>{o(x=>x.map(w=>{if(w.id===g){const _=typeof m=="function"?m(w):m;return b.replace&&mw(_)?_:{...w,..._}}return w}))},p=(g,m,b={replace:!1})=>{c(x=>x.map(w=>{if(w.id===g){const _=typeof m=="function"?m(w):m;return b.replace&&yB(_)?_:{...w,..._}}return w}))};return{getNodes:()=>t.getState().nodes.map(g=>({...g})),getNode:g=>{var m;return(m=l(g))==null?void 0:m.internals.userNode},getInternalNode:l,getEdges:()=>{const{edges:g=[]}=t.getState();return g.map(m=>({...m}))},getEdge:g=>t.getState().edgeLookup.get(g),setNodes:o,setEdges:c,addNodes:g=>{const m=Array.isArray(g)?g:[g];n.nodeQueue.push(b=>[...b,...m])},addEdges:g=>{const m=Array.isArray(g)?g:[g];n.edgeQueue.push(b=>[...b,...m])},toObject:()=>{const{nodes:g=[],edges:m=[],transform:b}=t.getState(),[x,w,_]=b;return{nodes:g.map(k=>({...k})),edges:m.map(k=>({...k})),viewport:{x,y:w,zoom:_}}},deleteElements:async({nodes:g=[],edges:m=[]})=>{const{nodes:b,edges:x,onNodesDelete:w,onEdgesDelete:_,triggerNodeChanges:k,triggerEdgeChanges:A,onDelete:S,onBeforeDelete:O}=t.getState(),{nodes:D,edges:M}=await Y6({nodesToRemove:g,edgesToRemove:m,nodes:b,edges:x,onBeforeDelete:O}),F=M.length>0,L=D.length>0;if(F){const U=M.map(gw);_==null||_(M),A(U)}if(L){const U=D.map(gw);w==null||w(D),k(U)}return(L||F)&&(S==null||S({nodes:D,edges:M})),{deletedNodes:D,deletedEdges:M}},getIntersectingNodes:(g,m=!0,b)=>{const x=$1(g),w=x?g:f(g),_=b!==void 0;return w?(b||t.getState().nodes).filter(k=>{const A=t.getState().nodeLookup.get(k.id);if(A&&!x&&(k.id===g.id||!A.internals.positionAbsolute))return!1;const S=ys(_?k:A),O=ro(S,w);return m&&O>0||O>=w.width*w.height}):[]},isNodeIntersecting:(g,m,b=!0)=>{const w=$1(g)?g:f(g);if(!w)return!1;const _=ro(w,m);return b&&_>0||_>=w.width*w.height},updateNode:d,updateNodeData:(g,m,b={replace:!1})=>{d(g,x=>{const w=typeof m=="function"?m(x):m;return b.replace?{...x,data:w}:{...x,data:{...x.data,...w}}},b)},updateEdge:p,updateEdgeData:(g,m,b={replace:!1})=>{p(g,x=>{const w=typeof m=="function"?m(x):m;return b.replace?{...x,data:w}:{...x,data:{...x.data,...w}}},b)},getNodesBounds:g=>{const{nodeLookup:m,nodeOrigin:b}=t.getState();return V6(g,{nodeLookup:m,nodeOrigin:b})},getHandleConnections:({type:g,id:m,nodeId:b})=>{var x;return Array.from(((x=t.getState().connectionLookup.get(`${b}-${g}${m?`-${m}`:""}`))==null?void 0:x.values())??[])},getNodeConnections:({type:g,handleId:m,nodeId:b})=>{var x;return Array.from(((x=t.getState().connectionLookup.get(`${b}${g?m?`-${g}-${m}`:`-${g}`:""}`))==null?void 0:x.values())??[])},fitView:async g=>{const m=t.getState().fitViewResolver??J6();return t.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:m}),n.nodeQueue.push(b=>[...b]),m.promise}}},[]);return W.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const bw=e=>e.selected,SB=typeof window<"u"?window:void 0;function kB({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ht(),{deleteElements:r}=sf(),s=ao(e,{actInsideInputWithModifier:!1}),l=ao(t,{target:SB});W.useEffect(()=>{if(s){const{edges:o,nodes:c}=n.getState();r({nodes:c.filter(bw),edges:o.filter(bw)}),n.setState({nodesSelectionActive:!1})}},[s]),W.useEffect(()=>{n.setState({multiSelectionActive:l})},[l])}function EB(e){const t=ht();W.useEffect(()=>{const n=()=>{var s,l;if(!e.current)return!1;const r=Lm(e.current);(r.height===0||r.width===0)&&((l=(s=t.getState()).onError)==null||l.call(s,"004",or.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const lf={position:"absolute",width:"100%",height:"100%",top:0,left:0},AB=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function TB({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:l=na.Free,zoomOnDoubleClick:o=!0,panOnDrag:c=!0,defaultViewport:f,translateExtent:d,minZoom:p,maxZoom:g,zoomActivationKeyCode:m,preventScrolling:b=!0,children:x,noWheelClassName:w,noPanClassName:_,onViewportChange:k,isControlledViewport:A,paneClickDistance:S}){const O=ht(),D=W.useRef(null),{userSelectionActive:M,lib:F}=Ge(AB,yt),L=ao(m),U=W.useRef();EB(D);const j=W.useCallback(H=>{k==null||k({x:H[0],y:H[1],zoom:H[2]}),A||O.setState({transform:H})},[k,A]);return W.useEffect(()=>{if(D.current){U.current=M8({domNode:D.current,minZoom:p,maxZoom:g,translateExtent:d,viewport:f,paneClickDistance:S,onDraggingChange:R=>O.setState({paneDragging:R}),onPanZoomStart:(R,$)=>{const{onViewportChangeStart:I,onMoveStart:P}=O.getState();P==null||P(R,$),I==null||I($)},onPanZoom:(R,$)=>{const{onViewportChange:I,onMove:P}=O.getState();P==null||P(R,$),I==null||I($)},onPanZoomEnd:(R,$)=>{const{onViewportChangeEnd:I,onMoveEnd:P}=O.getState();P==null||P(R,$),I==null||I($)}});const{x:H,y:B,zoom:q}=U.current.getViewport();return O.setState({panZoom:U.current,transform:[H,B,q],domNode:D.current.closest(".react-flow")}),()=>{var R;(R=U.current)==null||R.destroy()}}},[]),W.useEffect(()=>{var H;(H=U.current)==null||H.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:l,zoomOnDoubleClick:o,panOnDrag:c,zoomActivationKeyPressed:L,preventScrolling:b,noPanClassName:_,userSelectionActive:M,noWheelClassName:w,lib:F,onTransformChange:j})},[e,t,n,r,s,l,o,c,L,b,_,M,w,F,j]),C.jsx("div",{className:"react-flow__renderer",ref:D,style:lf,children:x})}const CB=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function NB(){const{userSelectionActive:e,userSelectionRect:t}=Ge(CB,yt);return e&&t?C.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const vp=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},OB=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function MB({isSelecting:e,selectionKeyPressed:t,selectionMode:n=no.Full,panOnDrag:r,selectionOnDrag:s,onSelectionStart:l,onSelectionEnd:o,onPaneClick:c,onPaneContextMenu:f,onPaneScroll:d,onPaneMouseEnter:p,onPaneMouseMove:g,onPaneMouseLeave:m,children:b}){const x=ht(),{userSelectionActive:w,elementsSelectable:_,dragging:k,connectionInProgress:A}=Ge(OB,yt),S=_&&(e||w),O=W.useRef(null),D=W.useRef(),M=W.useRef(new Set),F=W.useRef(new Set),L=W.useRef(!1),U=W.useRef(!1),j=P=>{if(L.current||A){L.current=!1;return}c==null||c(P),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},H=P=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){P.preventDefault();return}f==null||f(P)},B=d?P=>d(P):void 0,q=P=>{var te,T;const{resetSelectedElements:Y,domNode:X}=x.getState();if(D.current=X==null?void 0:X.getBoundingClientRect(),!_||!e||P.button!==0||P.target!==O.current||!D.current)return;(T=(te=P.target)==null?void 0:te.setPointerCapture)==null||T.call(te,P.pointerId),U.current=!0,L.current=!1;const{x:E,y:G}=Dr(P.nativeEvent,D.current);Y(),x.setState({userSelectionRect:{width:0,height:0,startX:E,startY:G,x:E,y:G}}),l==null||l(P)},R=P=>{const{userSelectionRect:Y,transform:X,nodeLookup:E,edgeLookup:G,connectionLookup:te,triggerNodeChanges:T,triggerEdgeChanges:V,defaultEdgeOptions:K}=x.getState();if(!D.current||!Y)return;L.current=!0;const{x:J,y:le}=Dr(P.nativeEvent,D.current),{startX:fe,startY:ye}=Y,Ae={startX:fe,startY:ye,x:J<fe?J:fe,y:le<ye?le:ye,width:Math.abs(J-fe),height:Math.abs(le-ye)},Se=M.current,be=F.current;M.current=new Set(Jk(E,Ae,X,n===no.Partial,!0).map(ze=>ze.id)),F.current=new Set;const je=(K==null?void 0:K.selectable)??!0;for(const ze of M.current){const lt=te.get(ze);if(lt)for(const{edgeId:ft}of lt.values()){const xt=G.get(ft);xt&&(xt.selectable??je)&&F.current.add(ft)}}if(!V1(Se,M.current)){const ze=ns(E,M.current,!0);T(ze)}if(!V1(be,F.current)){const ze=ns(G,F.current);V(ze)}x.setState({userSelectionRect:Ae,userSelectionActive:!0,nodesSelectionActive:!1})},$=P=>{var X,E;if(P.button!==0||!U.current)return;(E=(X=P.target)==null?void 0:X.releasePointerCapture)==null||E.call(X,P.pointerId);const{userSelectionRect:Y}=x.getState();!w&&Y&&P.target===O.current&&(j==null||j(P)),x.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:M.current.size>0}),o==null||o(P),(t||s)&&(L.current=!1),U.current=!1},I=r===!0||Array.isArray(r)&&r.includes(0);return C.jsxs("div",{className:Ct(["react-flow__pane",{draggable:I,dragging:k,selection:e}]),onClick:S?void 0:vp(j,O),onContextMenu:vp(H,O),onWheel:vp(B,O),onPointerEnter:S?void 0:p,onPointerDown:S?q:g,onPointerMove:S?R:g,onPointerUp:S?$:void 0,onPointerLeave:m,ref:O,style:lf,children:[b,C.jsx(NB,{})]})}function tm({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:l,multiSelectionActive:o,nodeLookup:c,onError:f}=t.getState(),d=c.get(e);if(!d){f==null||f("012",or.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&o)&&(l({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var p;return(p=r==null?void 0:r.current)==null?void 0:p.blur()})):s([e])}function RE({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:l,nodeClickDistance:o}){const c=ht(),[f,d]=W.useState(!1),p=W.useRef();return W.useEffect(()=>{p.current=y8({getStoreItems:()=>c.getState(),onNodeMouseDown:g=>{tm({id:g,store:c,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),W.useEffect(()=>{var g,m;if(t)(g=p.current)==null||g.destroy();else if(e.current)return(m=p.current)==null||m.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:l,nodeId:s,nodeClickDistance:o}),()=>{var b;(b=p.current)==null||b.destroy()}},[n,r,t,l,e,s]),f}const RB=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function DE(){const e=ht();return W.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:l,nodesDraggable:o,onError:c,updateNodePositions:f,nodeLookup:d,nodeOrigin:p}=e.getState(),g=new Map,m=RB(o),b=s?l[0]:5,x=s?l[1]:5,w=n.direction.x*b*n.factor,_=n.direction.y*x*n.factor;for(const[,k]of d){if(!m(k))continue;let A={x:k.internals.positionAbsolute.x+w,y:k.internals.positionAbsolute.y+_};s&&(A=nf(A,l));const{position:S,positionAbsolute:O}=Wk({nodeId:k.id,nextPosition:A,nodeLookup:d,nodeExtent:r,nodeOrigin:p,onError:c});k.position=S,k.internals.positionAbsolute=O,g.set(k.id,k)}f(g)},[])}const Um=W.createContext(null),DB=Um.Provider;Um.Consumer;const jE=()=>W.useContext(Um),jB=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),zB=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:l,connection:o}=r,{fromHandle:c,toHandle:f,isValid:d}=o,p=(f==null?void 0:f.nodeId)===e&&(f==null?void 0:f.id)===t&&(f==null?void 0:f.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:p,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:l===gs.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!s,valid:p&&d}};function LB({type:e="source",position:t=Ne.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:l=!0,id:o,onConnect:c,children:f,className:d,onMouseDown:p,onTouchStart:g,...m},b){var $,I;const x=o||null,w=e==="target",_=ht(),k=jE(),{connectOnClick:A,noPanClassName:S,rfId:O}=Ge(jB,yt),{connectingFrom:D,connectingTo:M,clickConnecting:F,isPossibleEndHandle:L,connectionInProcess:U,clickConnectionInProcess:j,valid:H}=Ge(zB(k,x,e),yt);k||(I=($=_.getState()).onError)==null||I.call($,"010",or.error010());const B=P=>{const{defaultEdgeOptions:Y,onConnect:X,hasDefaultEdges:E}=_.getState(),G={...Y,...P};if(E){const{edges:te,setEdges:T}=_.getState();T(i8(G,te))}X==null||X(G),c==null||c(G)},q=P=>{if(!k)return;const Y=lE(P.nativeEvent);if(s&&(Y&&P.button===0||!Y)){const X=_.getState();em.onPointerDown(P.nativeEvent,{autoPanOnConnect:X.autoPanOnConnect,connectionMode:X.connectionMode,connectionRadius:X.connectionRadius,domNode:X.domNode,nodeLookup:X.nodeLookup,lib:X.lib,isTarget:w,handleId:x,nodeId:k,flowId:X.rfId,panBy:X.panBy,cancelConnection:X.cancelConnection,onConnectStart:X.onConnectStart,onConnectEnd:X.onConnectEnd,updateConnection:X.updateConnection,onConnect:B,isValidConnection:n||X.isValidConnection,getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,autoPanSpeed:X.autoPanSpeed})}Y?p==null||p(P):g==null||g(P)},R=P=>{const{onClickConnectStart:Y,onClickConnectEnd:X,connectionClickStartHandle:E,connectionMode:G,isValidConnection:te,lib:T,rfId:V,nodeLookup:K,connection:J}=_.getState();if(!k||!E&&!s)return;if(!E){Y==null||Y(P.nativeEvent,{nodeId:k,handleId:x,handleType:e}),_.setState({connectionClickStartHandle:{nodeId:k,type:e,id:x}});return}const le=aE(P.target),fe=n||te,{connection:ye,isValid:Ae}=em.isValid(P.nativeEvent,{handle:{nodeId:k,id:x,type:e},connectionMode:G,fromNodeId:E.nodeId,fromHandleId:E.id||null,fromType:E.type,isValidConnection:fe,flowId:V,doc:le,lib:T,nodeLookup:K});Ae&&ye&&B(ye);const Se=structuredClone(J);delete Se.inProgress,Se.toPosition=Se.toHandle?Se.toHandle.position:null,X==null||X(P,Se),_.setState({connectionClickStartHandle:null})};return C.jsx("div",{"data-handleid":x,"data-nodeid":k,"data-handlepos":t,"data-id":`${O}-${k}-${x}-${e}`,className:Ct(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",S,d,{source:!w,target:w,connectable:r,connectablestart:s,connectableend:l,clickconnecting:F,connectingfrom:D,connectingto:M,valid:H,connectionindicator:r&&(!U||L)&&(U||j?l:s)}]),onMouseDown:q,onTouchStart:q,onClick:A?R:void 0,ref:b,...m,children:f})}const jc=W.memo(OE(LB));function IB({data:e,isConnectable:t,sourcePosition:n=Ne.Bottom}){return C.jsxs(C.Fragment,{children:[e==null?void 0:e.label,C.jsx(jc,{type:"source",position:n,isConnectable:t})]})}function BB({data:e,isConnectable:t,targetPosition:n=Ne.Top,sourcePosition:r=Ne.Bottom}){return C.jsxs(C.Fragment,{children:[C.jsx(jc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,C.jsx(jc,{type:"source",position:r,isConnectable:t})]})}function FB(){return null}function PB({data:e,isConnectable:t,targetPosition:n=Ne.Top}){return C.jsxs(C.Fragment,{children:[C.jsx(jc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const zc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},vw={input:IB,default:BB,output:PB,group:FB};function UB(e){var t,n,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const HB=e=>{const{width:t,height:n,x:r,y:s}=po(e.nodeLookup,{filter:l=>!!l.selected});return{width:qn(t)?t:null,height:qn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function $B({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ht(),{width:s,height:l,transformString:o,userSelectionActive:c}=Ge(HB,yt),f=DE(),d=W.useRef(null);if(W.useEffect(()=>{var m;n||(m=d.current)==null||m.focus({preventScroll:!0})},[n]),RE({nodeRef:d}),c||!s||!l)return null;const p=e?m=>{const b=r.getState().nodes.filter(x=>x.selected);e(m,b)}:void 0,g=m=>{Object.prototype.hasOwnProperty.call(zc,m.key)&&(m.preventDefault(),f({direction:zc[m.key],factor:m.shiftKey?4:1}))};return C.jsx("div",{className:Ct(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:C.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:s,height:l}})})}const xw=typeof window<"u"?window:void 0,VB=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function zE({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:l,onPaneScroll:o,paneClickDistance:c,deleteKeyCode:f,selectionKeyCode:d,selectionOnDrag:p,selectionMode:g,onSelectionStart:m,onSelectionEnd:b,multiSelectionKeyCode:x,panActivationKeyCode:w,zoomActivationKeyCode:_,elementsSelectable:k,zoomOnScroll:A,zoomOnPinch:S,panOnScroll:O,panOnScrollSpeed:D,panOnScrollMode:M,zoomOnDoubleClick:F,panOnDrag:L,defaultViewport:U,translateExtent:j,minZoom:H,maxZoom:B,preventScrolling:q,onSelectionContextMenu:R,noWheelClassName:$,noPanClassName:I,disableKeyboardA11y:P,onViewportChange:Y,isControlledViewport:X}){const{nodesSelectionActive:E,userSelectionActive:G}=Ge(VB),te=ao(d,{target:xw}),T=ao(w,{target:xw}),V=T||L,K=T||O,J=p&&V!==!0,le=te||G||J;return kB({deleteKeyCode:f,multiSelectionKeyCode:x}),C.jsx(TB,{onPaneContextMenu:l,elementsSelectable:k,zoomOnScroll:A,zoomOnPinch:S,panOnScroll:K,panOnScrollSpeed:D,panOnScrollMode:M,zoomOnDoubleClick:F,panOnDrag:!te&&V,defaultViewport:U,translateExtent:j,minZoom:H,maxZoom:B,zoomActivationKeyCode:_,preventScrolling:q,noWheelClassName:$,noPanClassName:I,onViewportChange:Y,isControlledViewport:X,paneClickDistance:c,children:C.jsxs(MB,{onSelectionStart:m,onSelectionEnd:b,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:l,onPaneScroll:o,panOnDrag:V,isSelecting:!!le,selectionMode:g,selectionKeyPressed:te,selectionOnDrag:J,children:[e,E&&C.jsx($B,{onSelectionContextMenu:R,noPanClassName:I,disableKeyboardA11y:P})]})})}zE.displayName="FlowRenderer";const qB=W.memo(zE),GB=e=>t=>e?Jk(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function ZB(e){return Ge(W.useCallback(GB(e),[e]),yt)}const YB=e=>e.updateNodeInternals;function XB(){const e=Ge(YB),[t]=W.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(s=>{const l=s.target.getAttribute("data-id");r.set(l,{id:l,nodeElement:s.target,force:!0})}),e(r)}));return W.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function QB({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=ht(),l=W.useRef(null),o=W.useRef(null),c=W.useRef(e.sourcePosition),f=W.useRef(e.targetPosition),d=W.useRef(t),p=n&&!!e.internals.handleBounds;return W.useEffect(()=>{l.current&&!e.hidden&&(!p||o.current!==l.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(l.current),o.current=l.current)},[p,e.hidden]),W.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),W.useEffect(()=>{if(l.current){const g=d.current!==t,m=c.current!==e.sourcePosition,b=f.current!==e.targetPosition;(g||m||b)&&(d.current=t,c.current=e.sourcePosition,f.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:l.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),l}function KB({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:l,onDoubleClick:o,nodesDraggable:c,elementsSelectable:f,nodesConnectable:d,nodesFocusable:p,resizeObserver:g,noDragClassName:m,noPanClassName:b,disableKeyboardA11y:x,rfId:w,nodeTypes:_,nodeClickDistance:k,onError:A}){const{node:S,internals:O,isParent:D}=Ge(le=>{const fe=le.nodeLookup.get(e),ye=le.parentLookup.has(e);return{node:fe,internals:fe.internals,isParent:ye}},yt);let M=S.type||"default",F=(_==null?void 0:_[M])||vw[M];F===void 0&&(A==null||A("003",or.error003(M)),M="default",F=vw.default);const L=!!(S.draggable||c&&typeof S.draggable>"u"),U=!!(S.selectable||f&&typeof S.selectable>"u"),j=!!(S.connectable||d&&typeof S.connectable>"u"),H=!!(S.focusable||p&&typeof S.focusable>"u"),B=ht(),q=rE(S),R=QB({node:S,nodeType:M,hasDimensions:q,resizeObserver:g}),$=RE({nodeRef:R,disabled:S.hidden||!L,noDragClassName:m,handleSelector:S.dragHandle,nodeId:e,isSelectable:U,nodeClickDistance:k}),I=DE();if(S.hidden)return null;const P=Ir(S),Y=UB(S),X=U||L||t||n||r||s,E=n?le=>n(le,{...O.userNode}):void 0,G=r?le=>r(le,{...O.userNode}):void 0,te=s?le=>s(le,{...O.userNode}):void 0,T=l?le=>l(le,{...O.userNode}):void 0,V=o?le=>o(le,{...O.userNode}):void 0,K=le=>{const{selectNodesOnDrag:fe,nodeDragThreshold:ye}=B.getState();U&&(!fe||!L||ye>0)&&tm({id:e,store:B,nodeRef:R}),t&&t(le,{...O.userNode})},J=le=>{if(!(sE(le.nativeEvent)||x))if(Yk.includes(le.key)&&U){const fe=le.key==="Escape";tm({id:e,store:B,unselect:fe,nodeRef:R})}else L&&S.selected&&Object.prototype.hasOwnProperty.call(zc,le.key)&&(le.preventDefault(),B.setState({ariaLiveMessage:`Moved selected node ${le.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~O.positionAbsolute.x}, y: ${~~O.positionAbsolute.y}`}),I({direction:zc[le.key],factor:le.shiftKey?4:1}))};return C.jsx("div",{className:Ct(["react-flow__node",`react-flow__node-${M}`,{[b]:L},S.className,{selected:S.selected,selectable:U,parent:D,draggable:L,dragging:$}]),ref:R,style:{zIndex:O.z,transform:`translate(${O.positionAbsolute.x}px,${O.positionAbsolute.y}px)`,pointerEvents:X?"all":"none",visibility:q?"visible":"hidden",...S.style,...Y},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:E,onMouseMove:G,onMouseLeave:te,onContextMenu:T,onClick:K,onDoubleClick:V,onKeyDown:H?J:void 0,tabIndex:H?0:void 0,role:H?"button":void 0,"aria-describedby":x?void 0:`${kE}-${w}`,"aria-label":S.ariaLabel,children:C.jsx(DB,{value:e,children:C.jsx(F,{id:e,data:S.data,type:M,positionAbsoluteX:O.positionAbsolute.x,positionAbsoluteY:O.positionAbsolute.y,selected:S.selected??!1,selectable:U,draggable:L,deletable:S.deletable??!0,isConnectable:j,sourcePosition:S.sourcePosition,targetPosition:S.targetPosition,dragging:$,dragHandle:S.dragHandle,zIndex:O.z,parentId:S.parentId,...P})})})}const JB=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function LE(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:l}=Ge(JB,yt),o=ZB(e.onlyRenderVisibleElements),c=XB();return C.jsx("div",{className:"react-flow__nodes",style:lf,children:o.map(f=>C.jsx(KB,{id:f,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:l},f))})}LE.displayName="NodeRenderer";const WB=W.memo(LE);function e7(e){return Ge(W.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const r=[];if(n.width&&n.height)for(const s of n.edges){const l=n.nodeLookup.get(s.source),o=n.nodeLookup.get(s.target);l&&o&&t8({sourceNode:l,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),yt)}const t7=({color:e="none",strokeWidth:t=1})=>C.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),n7=({color:e="none",strokeWidth:t=1})=>C.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),ww={[Oc.Arrow]:t7,[Oc.ArrowClosed]:n7};function r7(e){const t=ht();return W.useMemo(()=>{var s,l;return Object.prototype.hasOwnProperty.call(ww,e)?ww[e]:((l=(s=t.getState()).onError)==null||l.call(s,"009",or.error009(e)),null)},[e])}const i7=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:l="strokeWidth",strokeWidth:o,orient:c="auto-start-reverse"})=>{const f=r7(t);return f?C.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:c,refX:"0",refY:"0",children:C.jsx(f,{color:n,strokeWidth:o})}):null},IE=({defaultColor:e,rfId:t})=>{const n=Ge(l=>l.edges),r=Ge(l=>l.defaultEdgeOptions),s=W.useMemo(()=>u8(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return s.length?C.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:C.jsx("defs",{children:s.map(l=>C.jsx(i7,{id:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,strokeWidth:l.strokeWidth,orient:l.orient},l.id))})}):null};IE.displayName="MarkerDefinitions";var a7=W.memo(IE);function BE({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:l,labelBgPadding:o=[2,4],labelBgBorderRadius:c=2,children:f,className:d,...p}){const[g,m]=W.useState({x:1,y:0,width:0,height:0}),b=Ct(["react-flow__edge-textwrapper",d]),x=W.useRef(null);return W.useEffect(()=>{if(x.current){const w=x.current.getBBox();m({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?C.jsxs("g",{transform:`translate(${e-g.width/2} ${t-g.height/2})`,className:b,visibility:g.width?"visible":"hidden",...p,children:[s&&C.jsx("rect",{width:g.width+2*o[0],x:-o[0],y:-o[1],height:g.height+2*o[1],className:"react-flow__edge-textbg",style:l,rx:c,ry:c}),C.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:x,style:r,children:n}),f]}):null}BE.displayName="EdgeText";const s7=W.memo(BE);function of({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:l,labelBgStyle:o,labelBgPadding:c,labelBgBorderRadius:f,interactionWidth:d=20,...p}){return C.jsxs(C.Fragment,{children:[C.jsx("path",{...p,d:e,fill:"none",className:Ct(["react-flow__edge-path",p.className])}),d&&C.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}),r&&qn(t)&&qn(n)?C.jsx(s7,{x:t,y:n,label:r,labelStyle:s,labelShowBg:l,labelBgStyle:o,labelBgPadding:c,labelBgBorderRadius:f}):null]})}function _w({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===Ne.Left||e===Ne.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function FE({sourceX:e,sourceY:t,sourcePosition:n=Ne.Bottom,targetX:r,targetY:s,targetPosition:l=Ne.Top}){const[o,c]=_w({pos:n,x1:e,y1:t,x2:r,y2:s}),[f,d]=_w({pos:l,x1:r,y1:s,x2:e,y2:t}),[p,g,m,b]=oE({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:o,sourceControlY:c,targetControlX:f,targetControlY:d});return[`M${e},${t} C${o},${c} ${f},${d} ${r},${s}`,p,g,m,b]}function PE(e){return W.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:l,sourcePosition:o,targetPosition:c,label:f,labelStyle:d,labelShowBg:p,labelBgStyle:g,labelBgPadding:m,labelBgBorderRadius:b,style:x,markerEnd:w,markerStart:_,interactionWidth:k})=>{const[A,S,O]=FE({sourceX:n,sourceY:r,sourcePosition:o,targetX:s,targetY:l,targetPosition:c}),D=e.isInternal?void 0:t;return C.jsx(of,{id:D,path:A,labelX:S,labelY:O,label:f,labelStyle:d,labelShowBg:p,labelBgStyle:g,labelBgPadding:m,labelBgBorderRadius:b,style:x,markerEnd:w,markerStart:_,interactionWidth:k})})}const l7=PE({isInternal:!1}),UE=PE({isInternal:!0});l7.displayName="SimpleBezierEdge";UE.displayName="SimpleBezierEdgeInternal";function HE(e){return W.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:l,label:o,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:g,style:m,sourcePosition:b=Ne.Bottom,targetPosition:x=Ne.Top,markerEnd:w,markerStart:_,pathOptions:k,interactionWidth:A})=>{const[S,O,D]=Kg({sourceX:n,sourceY:r,sourcePosition:b,targetX:s,targetY:l,targetPosition:x,borderRadius:k==null?void 0:k.borderRadius,offset:k==null?void 0:k.offset}),M=e.isInternal?void 0:t;return C.jsx(of,{id:M,path:S,labelX:O,labelY:D,label:o,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:g,style:m,markerEnd:w,markerStart:_,interactionWidth:A})})}const $E=HE({isInternal:!1}),VE=HE({isInternal:!0});$E.displayName="SmoothStepEdge";VE.displayName="SmoothStepEdgeInternal";function qE(e){return W.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return C.jsx($E,{...n,id:r,pathOptions:W.useMemo(()=>{var l;return{borderRadius:0,offset:(l=n.pathOptions)==null?void 0:l.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const o7=qE({isInternal:!1}),GE=qE({isInternal:!0});o7.displayName="StepEdge";GE.displayName="StepEdgeInternal";function ZE(e){return W.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:l,label:o,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:g,style:m,markerEnd:b,markerStart:x,interactionWidth:w})=>{const[_,k,A]=fE({sourceX:n,sourceY:r,targetX:s,targetY:l}),S=e.isInternal?void 0:t;return C.jsx(of,{id:S,path:_,labelX:k,labelY:A,label:o,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:g,style:m,markerEnd:b,markerStart:x,interactionWidth:w})})}const u7=ZE({isInternal:!1}),YE=ZE({isInternal:!0});u7.displayName="StraightEdge";YE.displayName="StraightEdgeInternal";function XE(e){return W.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:l,sourcePosition:o=Ne.Bottom,targetPosition:c=Ne.Top,label:f,labelStyle:d,labelShowBg:p,labelBgStyle:g,labelBgPadding:m,labelBgBorderRadius:b,style:x,markerEnd:w,markerStart:_,pathOptions:k,interactionWidth:A})=>{const[S,O,D]=uE({sourceX:n,sourceY:r,sourcePosition:o,targetX:s,targetY:l,targetPosition:c,curvature:k==null?void 0:k.curvature}),M=e.isInternal?void 0:t;return C.jsx(of,{id:M,path:S,labelX:O,labelY:D,label:f,labelStyle:d,labelShowBg:p,labelBgStyle:g,labelBgPadding:m,labelBgBorderRadius:b,style:x,markerEnd:w,markerStart:_,interactionWidth:A})})}const c7=XE({isInternal:!1}),QE=XE({isInternal:!0});c7.displayName="BezierEdge";QE.displayName="BezierEdgeInternal";const Sw={default:QE,straight:YE,step:GE,smoothstep:VE,simplebezier:UE},kw={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},f7=(e,t,n)=>n===Ne.Left?e-t:n===Ne.Right?e+t:e,d7=(e,t,n)=>n===Ne.Top?e-t:n===Ne.Bottom?e+t:e,Ew="react-flow__edgeupdater";function Aw({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:l,onMouseOut:o,type:c}){return C.jsx("circle",{onMouseDown:s,onMouseEnter:l,onMouseOut:o,className:Ct([Ew,`${Ew}-${c}`]),cx:f7(t,r,e),cy:d7(n,r,e),r,stroke:"transparent",fill:"transparent"})}function h7({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:l,targetY:o,sourcePosition:c,targetPosition:f,onReconnect:d,onReconnectStart:p,onReconnectEnd:g,setReconnecting:m,setUpdateHover:b}){const x=ht(),w=(O,D)=>{if(O.button!==0)return;const{autoPanOnConnect:M,domNode:F,isValidConnection:L,connectionMode:U,connectionRadius:j,lib:H,onConnectStart:B,onConnectEnd:q,cancelConnection:R,nodeLookup:$,rfId:I,panBy:P,updateConnection:Y}=x.getState(),X=D.type==="target";m(!0),p==null||p(O,n,D.type);const E=(te,T)=>{m(!1),g==null||g(te,n,D.type,T)},G=te=>d==null?void 0:d(n,te);em.onPointerDown(O.nativeEvent,{autoPanOnConnect:M,connectionMode:U,connectionRadius:j,domNode:F,handleId:D.id,nodeId:D.nodeId,nodeLookup:$,isTarget:X,edgeUpdaterType:D.type,lib:H,flowId:I,cancelConnection:R,panBy:P,isValidConnection:L,onConnect:G,onConnectStart:B,onConnectEnd:q,onReconnectEnd:E,updateConnection:Y,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle})},_=O=>w(O,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),k=O=>w(O,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),A=()=>b(!0),S=()=>b(!1);return C.jsxs(C.Fragment,{children:[(e===!0||e==="source")&&C.jsx(Aw,{position:c,centerX:r,centerY:s,radius:t,onMouseDown:_,onMouseEnter:A,onMouseOut:S,type:"source"}),(e===!0||e==="target")&&C.jsx(Aw,{position:f,centerX:l,centerY:o,radius:t,onMouseDown:k,onMouseEnter:A,onMouseOut:S,type:"target"})]})}function p7({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:l,onContextMenu:o,onMouseEnter:c,onMouseMove:f,onMouseLeave:d,reconnectRadius:p,onReconnect:g,onReconnectStart:m,onReconnectEnd:b,rfId:x,edgeTypes:w,noPanClassName:_,onError:k,disableKeyboardA11y:A}){let S=Ge(be=>be.edgeLookup.get(e));const O=Ge(be=>be.defaultEdgeOptions);S=O?{...O,...S}:S;let D=S.type||"default",M=(w==null?void 0:w[D])||Sw[D];M===void 0&&(k==null||k("011",or.error011(D)),D="default",M=Sw.default);const F=!!(S.focusable||t&&typeof S.focusable>"u"),L=typeof g<"u"&&(S.reconnectable||n&&typeof S.reconnectable>"u"),U=!!(S.selectable||r&&typeof S.selectable>"u"),j=W.useRef(null),[H,B]=W.useState(!1),[q,R]=W.useState(!1),$=ht(),{zIndex:I,sourceX:P,sourceY:Y,targetX:X,targetY:E,sourcePosition:G,targetPosition:te}=Ge(W.useCallback(be=>{const je=be.nodeLookup.get(S.source),ze=be.nodeLookup.get(S.target);if(!je||!ze)return{zIndex:S.zIndex,...kw};const lt=o8({id:e,sourceNode:je,targetNode:ze,sourceHandle:S.sourceHandle||null,targetHandle:S.targetHandle||null,connectionMode:be.connectionMode,onError:k});return{zIndex:e8({selected:S.selected,zIndex:S.zIndex,sourceNode:je,targetNode:ze,elevateOnSelect:be.elevateEdgesOnSelect}),...lt||kw}},[S.source,S.target,S.sourceHandle,S.targetHandle,S.selected,S.zIndex]),yt),T=W.useMemo(()=>S.markerStart?`url('#${Jg(S.markerStart,x)}')`:void 0,[S.markerStart,x]),V=W.useMemo(()=>S.markerEnd?`url('#${Jg(S.markerEnd,x)}')`:void 0,[S.markerEnd,x]);if(S.hidden||P===null||Y===null||X===null||E===null)return null;const K=be=>{var ft;const{addSelectedEdges:je,unselectNodesAndEdges:ze,multiSelectionActive:lt}=$.getState();U&&($.setState({nodesSelectionActive:!1}),S.selected&<?(ze({nodes:[],edges:[S]}),(ft=j.current)==null||ft.blur()):je([e])),s&&s(be,S)},J=l?be=>{l(be,{...S})}:void 0,le=o?be=>{o(be,{...S})}:void 0,fe=c?be=>{c(be,{...S})}:void 0,ye=f?be=>{f(be,{...S})}:void 0,Ae=d?be=>{d(be,{...S})}:void 0,Se=be=>{var je;if(!A&&Yk.includes(be.key)&&U){const{unselectNodesAndEdges:ze,addSelectedEdges:lt}=$.getState();be.key==="Escape"?((je=j.current)==null||je.blur(),ze({edges:[S]})):lt([e])}};return C.jsx("svg",{style:{zIndex:I},children:C.jsxs("g",{className:Ct(["react-flow__edge",`react-flow__edge-${D}`,S.className,_,{selected:S.selected,animated:S.animated,inactive:!U&&!s,updating:H,selectable:U}]),onClick:K,onDoubleClick:J,onContextMenu:le,onMouseEnter:fe,onMouseMove:ye,onMouseLeave:Ae,onKeyDown:F?Se:void 0,tabIndex:F?0:void 0,role:F?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":S.ariaLabel===null?void 0:S.ariaLabel||`Edge from ${S.source} to ${S.target}`,"aria-describedby":F?`${EE}-${x}`:void 0,ref:j,children:[!q&&C.jsx(M,{id:e,source:S.source,target:S.target,type:S.type,selected:S.selected,animated:S.animated,selectable:U,deletable:S.deletable??!0,label:S.label,labelStyle:S.labelStyle,labelShowBg:S.labelShowBg,labelBgStyle:S.labelBgStyle,labelBgPadding:S.labelBgPadding,labelBgBorderRadius:S.labelBgBorderRadius,sourceX:P,sourceY:Y,targetX:X,targetY:E,sourcePosition:G,targetPosition:te,data:S.data,style:S.style,sourceHandleId:S.sourceHandle,targetHandleId:S.targetHandle,markerStart:T,markerEnd:V,pathOptions:"pathOptions"in S?S.pathOptions:void 0,interactionWidth:S.interactionWidth}),L&&C.jsx(h7,{edge:S,isReconnectable:L,reconnectRadius:p,onReconnect:g,onReconnectStart:m,onReconnectEnd:b,sourceX:P,sourceY:Y,targetX:X,targetY:E,sourcePosition:G,targetPosition:te,setUpdateHover:B,setReconnecting:R})]})})}const g7=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function KE({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:l,onEdgeContextMenu:o,onEdgeMouseEnter:c,onEdgeMouseMove:f,onEdgeMouseLeave:d,onEdgeClick:p,reconnectRadius:g,onEdgeDoubleClick:m,onReconnectStart:b,onReconnectEnd:x,disableKeyboardA11y:w}){const{edgesFocusable:_,edgesReconnectable:k,elementsSelectable:A,onError:S}=Ge(g7,yt),O=e7(t);return C.jsxs("div",{className:"react-flow__edges",children:[C.jsx(a7,{defaultColor:e,rfId:n}),O.map(D=>C.jsx(p7,{id:D,edgesFocusable:_,edgesReconnectable:k,elementsSelectable:A,noPanClassName:s,onReconnect:l,onContextMenu:o,onMouseEnter:c,onMouseMove:f,onMouseLeave:d,onClick:p,reconnectRadius:g,onDoubleClick:m,onReconnectStart:b,onReconnectEnd:x,rfId:n,onError:S,edgeTypes:r,disableKeyboardA11y:w},D))]})}KE.displayName="EdgeRenderer";const m7=W.memo(KE),y7=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function b7({children:e}){const t=Ge(y7);return C.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function v7(e){const t=sf(),n=W.useRef(!1);W.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const x7=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function w7(e){const t=Ge(x7),n=ht();return W.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function _7(e){return e.connection.inProgress?{...e.connection,to:go(e.connection.to,e.transform)}:{...e.connection}}function S7(e){return _7}function k7(e){const t=S7();return Ge(t,yt)}const E7=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function A7({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:l,height:o,isValid:c,inProgress:f}=Ge(E7,yt);return!(l&&s&&f)?null:C.jsx("svg",{style:e,width:l,height:o,className:"react-flow__connectionline react-flow__container",children:C.jsx("g",{className:Ct(["react-flow__connection",Qk(c)]),children:C.jsx(JE,{style:t,type:n,CustomComponent:r,isValid:c})})})}const JE=({style:e,type:t=bi.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:l,fromNode:o,fromHandle:c,fromPosition:f,to:d,toNode:p,toHandle:g,toPosition:m}=k7();if(!s)return;if(n)return C.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:c,fromX:l.x,fromY:l.y,toX:d.x,toY:d.y,fromPosition:f,toPosition:m,connectionStatus:Qk(r),toNode:p,toHandle:g});let b="";const x={sourceX:l.x,sourceY:l.y,sourcePosition:f,targetX:d.x,targetY:d.y,targetPosition:m};switch(t){case bi.Bezier:[b]=uE(x);break;case bi.SimpleBezier:[b]=FE(x);break;case bi.Step:[b]=Kg({...x,borderRadius:0});break;case bi.SmoothStep:[b]=Kg(x);break;default:[b]=fE(x)}return C.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};JE.displayName="ConnectionLine";const T7={};function Tw(e=T7){W.useRef(e),ht(),W.useEffect(()=>{},[e])}function C7(){ht(),W.useRef(!1),W.useEffect(()=>{},[])}function WE({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:l,onEdgeDoubleClick:o,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:d,onNodeContextMenu:p,onSelectionContextMenu:g,onSelectionStart:m,onSelectionEnd:b,connectionLineType:x,connectionLineStyle:w,connectionLineComponent:_,connectionLineContainerStyle:k,selectionKeyCode:A,selectionOnDrag:S,selectionMode:O,multiSelectionKeyCode:D,panActivationKeyCode:M,zoomActivationKeyCode:F,deleteKeyCode:L,onlyRenderVisibleElements:U,elementsSelectable:j,defaultViewport:H,translateExtent:B,minZoom:q,maxZoom:R,preventScrolling:$,defaultMarkerColor:I,zoomOnScroll:P,zoomOnPinch:Y,panOnScroll:X,panOnScrollSpeed:E,panOnScrollMode:G,zoomOnDoubleClick:te,panOnDrag:T,onPaneClick:V,onPaneMouseEnter:K,onPaneMouseMove:J,onPaneMouseLeave:le,onPaneScroll:fe,onPaneContextMenu:ye,paneClickDistance:Ae,nodeClickDistance:Se,onEdgeContextMenu:be,onEdgeMouseEnter:je,onEdgeMouseMove:ze,onEdgeMouseLeave:lt,reconnectRadius:ft,onReconnect:xt,onReconnectStart:Ai,onReconnectEnd:fr,noDragClassName:Dn,noWheelClassName:Xn,noPanClassName:dr,disableKeyboardA11y:Qn,nodeExtent:Ti,rfId:Kn,viewport:se,onViewportChange:he}){return Tw(e),Tw(t),C7(),v7(n),w7(se),C.jsx(qB,{onPaneClick:V,onPaneMouseEnter:K,onPaneMouseMove:J,onPaneMouseLeave:le,onPaneContextMenu:ye,onPaneScroll:fe,paneClickDistance:Ae,deleteKeyCode:L,selectionKeyCode:A,selectionOnDrag:S,selectionMode:O,onSelectionStart:m,onSelectionEnd:b,multiSelectionKeyCode:D,panActivationKeyCode:M,zoomActivationKeyCode:F,elementsSelectable:j,zoomOnScroll:P,zoomOnPinch:Y,zoomOnDoubleClick:te,panOnScroll:X,panOnScrollSpeed:E,panOnScrollMode:G,panOnDrag:T,defaultViewport:H,translateExtent:B,minZoom:q,maxZoom:R,onSelectionContextMenu:g,preventScrolling:$,noDragClassName:Dn,noWheelClassName:Xn,noPanClassName:dr,disableKeyboardA11y:Qn,onViewportChange:he,isControlledViewport:!!se,children:C.jsxs(b7,{children:[C.jsx(m7,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:o,onReconnect:xt,onReconnectStart:Ai,onReconnectEnd:fr,onlyRenderVisibleElements:U,onEdgeContextMenu:be,onEdgeMouseEnter:je,onEdgeMouseMove:ze,onEdgeMouseLeave:lt,reconnectRadius:ft,defaultMarkerColor:I,noPanClassName:dr,disableKeyboardA11y:Qn,rfId:Kn}),C.jsx(A7,{style:w,type:x,component:_,containerStyle:k}),C.jsx("div",{className:"react-flow__edgelabel-renderer"}),C.jsx(WB,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:d,onNodeContextMenu:p,nodeClickDistance:Se,onlyRenderVisibleElements:U,noPanClassName:dr,noDragClassName:Dn,disableKeyboardA11y:Qn,nodeExtent:Ti,rfId:Kn}),C.jsx("div",{className:"react-flow__viewport-portal"})]})})}WE.displayName="GraphView";const N7=W.memo(WE),Cw=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:l,fitView:o,fitViewOptions:c,minZoom:f=.5,maxZoom:d=2,nodeOrigin:p,nodeExtent:g}={})=>{const m=new Map,b=new Map,x=new Map,w=new Map,_=r??t??[],k=n??e??[],A=p??[0,0],S=g??to;hE(x,w,_);const O=Wg(k,m,b,{nodeOrigin:A,nodeExtent:S,elevateNodesOnSelect:!1});let D=[0,0,1];if(o&&s&&l){const M=po(m,{filter:j=>!!((j.width||j.initialWidth)&&(j.height||j.initialHeight))}),{x:F,y:L,zoom:U}=zm(M,s,l,f,d,(c==null?void 0:c.padding)??.1);D=[F,L,U]}return{rfId:"1",width:0,height:0,transform:D,nodes:k,nodesInitialized:O,nodeLookup:m,parentLookup:b,edges:_,edgeLookup:w,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:f,maxZoom:d,translateExtent:to,nodeExtent:S,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:gs.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:A,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:c,fitViewResolver:null,connection:{...Xk},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:X6,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},O7=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:l,fitView:o,fitViewOptions:c,minZoom:f,maxZoom:d,nodeOrigin:p,nodeExtent:g})=>Q8((m,b)=>{async function x(){const{nodeLookup:w,panZoom:_,fitViewOptions:k,fitViewResolver:A,width:S,height:O,minZoom:D,maxZoom:M}=b();_&&(await Z6({nodes:w,width:S,height:O,panZoom:_,minZoom:D,maxZoom:M},k),A==null||A.resolve(!0),m({fitViewResolver:null}))}return{...Cw({nodes:e,edges:t,width:s,height:l,fitView:o,fitViewOptions:c,minZoom:f,maxZoom:d,nodeOrigin:p,nodeExtent:g,defaultNodes:n,defaultEdges:r}),setNodes:w=>{const{nodeLookup:_,parentLookup:k,nodeOrigin:A,elevateNodesOnSelect:S,fitViewQueued:O}=b(),D=Wg(w,_,k,{nodeOrigin:A,nodeExtent:g,elevateNodesOnSelect:S,checkEquality:!0});O&&D?(x(),m({nodes:w,nodesInitialized:D,fitViewQueued:!1,fitViewOptions:void 0})):m({nodes:w,nodesInitialized:D})},setEdges:w=>{const{connectionLookup:_,edgeLookup:k}=b();hE(_,k,w),m({edges:w})},setDefaultNodesAndEdges:(w,_)=>{if(w){const{setNodes:k}=b();k(w),m({hasDefaultNodes:!0})}if(_){const{setEdges:k}=b();k(_),m({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:_,nodeLookup:k,parentLookup:A,domNode:S,nodeOrigin:O,nodeExtent:D,debug:M,fitViewQueued:F}=b(),{changes:L,updatedInternals:U}=p8(w,k,A,S,O,D);U&&(f8(k,A,{nodeOrigin:O,nodeExtent:D}),F?(x(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(L==null?void 0:L.length)>0&&(M&&console.log("React Flow: trigger node changes",L),_==null||_(L)))},updateNodePositions:(w,_=!1)=>{const k=[],A=[],{nodeLookup:S,triggerNodeChanges:O}=b();for(const[D,M]of w){const F=S.get(D),L=!!(F!=null&&F.expandParent&&(F!=null&&F.parentId)&&(M!=null&&M.position)),U={id:D,type:"position",position:L?{x:Math.max(0,M.position.x),y:Math.max(0,M.position.y)}:M.position,dragging:_};L&&F.parentId&&k.push({id:D,parentId:F.parentId,rect:{...M.internals.positionAbsolute,width:M.measured.width??0,height:M.measured.height??0}}),A.push(U)}if(k.length>0){const{parentLookup:D,nodeOrigin:M}=b(),F=Pm(k,S,D,M);A.push(...F)}O(A)},triggerNodeChanges:w=>{const{onNodesChange:_,setNodes:k,nodes:A,hasDefaultNodes:S,debug:O}=b();if(w!=null&&w.length){if(S){const D=CE(w,A);k(D)}O&&console.log("React Flow: trigger node changes",w),_==null||_(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:_,setEdges:k,edges:A,hasDefaultEdges:S,debug:O}=b();if(w!=null&&w.length){if(S){const D=NE(w,A);k(D)}O&&console.log("React Flow: trigger edge changes",w),_==null||_(w)}},addSelectedNodes:w=>{const{multiSelectionActive:_,edgeLookup:k,nodeLookup:A,triggerNodeChanges:S,triggerEdgeChanges:O}=b();if(_){const D=w.map(M=>Yi(M,!0));S(D);return}S(ns(A,new Set([...w]),!0)),O(ns(k))},addSelectedEdges:w=>{const{multiSelectionActive:_,edgeLookup:k,nodeLookup:A,triggerNodeChanges:S,triggerEdgeChanges:O}=b();if(_){const D=w.map(M=>Yi(M,!0));O(D);return}O(ns(k,new Set([...w]))),S(ns(A,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:_}={})=>{const{edges:k,nodes:A,nodeLookup:S,triggerNodeChanges:O,triggerEdgeChanges:D}=b(),M=w||A,F=_||k,L=M.map(j=>{const H=S.get(j.id);return H&&(H.selected=!1),Yi(j.id,!1)}),U=F.map(j=>Yi(j.id,!1));O(L),D(U)},setMinZoom:w=>{const{panZoom:_,maxZoom:k}=b();_==null||_.setScaleExtent([w,k]),m({minZoom:w})},setMaxZoom:w=>{const{panZoom:_,minZoom:k}=b();_==null||_.setScaleExtent([k,w]),m({maxZoom:w})},setTranslateExtent:w=>{var _;(_=b().panZoom)==null||_.setTranslateExtent(w),m({translateExtent:w})},setPaneClickDistance:w=>{var _;(_=b().panZoom)==null||_.setClickDistance(w)},resetSelectedElements:()=>{const{edges:w,nodes:_,triggerNodeChanges:k,triggerEdgeChanges:A,elementsSelectable:S}=b();if(!S)return;const O=_.reduce((M,F)=>F.selected?[...M,Yi(F.id,!1)]:M,[]),D=w.reduce((M,F)=>F.selected?[...M,Yi(F.id,!1)]:M,[]);k(O),A(D)},setNodeExtent:w=>{const{nodes:_,nodeLookup:k,parentLookup:A,nodeOrigin:S,elevateNodesOnSelect:O,nodeExtent:D}=b();w[0][0]===D[0][0]&&w[0][1]===D[0][1]&&w[1][0]===D[1][0]&&w[1][1]===D[1][1]||(Wg(_,k,A,{nodeOrigin:S,nodeExtent:w,elevateNodesOnSelect:O,checkEquality:!1}),m({nodeExtent:w}))},panBy:w=>{const{transform:_,width:k,height:A,panZoom:S,translateExtent:O}=b();return g8({delta:w,panZoom:S,transform:_,translateExtent:O,width:k,height:A})},cancelConnection:()=>{m({connection:{...Xk}})},updateConnection:w=>{m({connection:w})},reset:()=>m({...Cw()})}},Object.is);function e2({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:l,initialMinZoom:o,initialMaxZoom:c,initialFitViewOptions:f,fitView:d,nodeOrigin:p,nodeExtent:g,children:m}){const[b]=W.useState(()=>O7({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:l,fitView:d,minZoom:o,maxZoom:c,fitViewOptions:f,nodeOrigin:p,nodeExtent:g}));return C.jsx(K8,{value:b,children:C.jsx(xB,{children:m})})}function M7({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:l,height:o,fitView:c,fitViewOptions:f,minZoom:d,maxZoom:p,nodeOrigin:g,nodeExtent:m}){return W.useContext(af)?C.jsx(C.Fragment,{children:e}):C.jsx(e2,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:l,initialHeight:o,fitView:c,initialFitViewOptions:f,initialMinZoom:d,initialMaxZoom:p,nodeOrigin:g,nodeExtent:m,children:e})}const R7={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function D7({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:l,edgeTypes:o,onNodeClick:c,onEdgeClick:f,onInit:d,onMove:p,onMoveStart:g,onMoveEnd:m,onConnect:b,onConnectStart:x,onConnectEnd:w,onClickConnectStart:_,onClickConnectEnd:k,onNodeMouseEnter:A,onNodeMouseMove:S,onNodeMouseLeave:O,onNodeContextMenu:D,onNodeDoubleClick:M,onNodeDragStart:F,onNodeDrag:L,onNodeDragStop:U,onNodesDelete:j,onEdgesDelete:H,onDelete:B,onSelectionChange:q,onSelectionDragStart:R,onSelectionDrag:$,onSelectionDragStop:I,onSelectionContextMenu:P,onSelectionStart:Y,onSelectionEnd:X,onBeforeDelete:E,connectionMode:G,connectionLineType:te=bi.Bezier,connectionLineStyle:T,connectionLineComponent:V,connectionLineContainerStyle:K,deleteKeyCode:J="Backspace",selectionKeyCode:le="Shift",selectionOnDrag:fe=!1,selectionMode:ye=no.Full,panActivationKeyCode:Ae="Space",multiSelectionKeyCode:Se=Dc()?"Meta":"Control",zoomActivationKeyCode:be=Dc()?"Meta":"Control",snapToGrid:je,snapGrid:ze,onlyRenderVisibleElements:lt=!1,selectNodesOnDrag:ft,nodesDraggable:xt,nodesConnectable:Ai,nodesFocusable:fr,nodeOrigin:Dn=AE,edgesFocusable:Xn,edgesReconnectable:dr,elementsSelectable:Qn=!0,defaultViewport:Ti=cB,minZoom:Kn=.5,maxZoom:se=2,translateExtent:he=to,preventScrolling:Ee=!0,nodeExtent:Te,defaultMarkerColor:Qe="#b1b1b7",zoomOnScroll:Gt=!0,zoomOnPinch:jn=!0,panOnScroll:Pt=!1,panOnScrollSpeed:Sn=.5,panOnScrollMode:Zt=na.Free,zoomOnDoubleClick:wt=!0,panOnDrag:Kt=!0,onPaneClick:un,onPaneMouseEnter:yo,onPaneMouseMove:bo,onPaneMouseLeave:_s,onPaneScroll:Ci,onPaneContextMenu:uf,paneClickDistance:Ss=0,nodeClickDistance:vo=0,children:ks,onReconnect:Es,onReconnectStart:xo,onReconnectEnd:cf,onEdgeContextMenu:Jn,onEdgeDoubleClick:Mt,onEdgeMouseEnter:Ut,onEdgeMouseMove:Br,onEdgeMouseLeave:As,reconnectRadius:ff=10,onNodesChange:df,onEdgesChange:wo,noDragClassName:Ni="nodrag",noWheelClassName:Ts="nowheel",noPanClassName:hr="nopan",fitView:pr,fitViewOptions:Fr,connectOnClick:Pr,attributionPosition:_t,proOptions:_o,defaultEdgeOptions:So,elevateNodesOnSelect:gr,elevateEdgesOnSelect:Ur,disableKeyboardA11y:ko=!1,autoPanOnConnect:Eo,autoPanOnNodeDrag:Ao,autoPanSpeed:hf,connectionRadius:ua,isValidConnection:ca,onError:zn,style:Cs,id:Ns,nodeDragThreshold:Hr,viewport:Os,onViewportChange:Ms,width:pf,height:To,colorMode:Jt="light",debug:Co,onScroll:fa,...da},No){const $r=Ns||"1",gf=pB(Jt),Wt=W.useCallback(ha=>{ha.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),fa==null||fa(ha)},[fa]);return C.jsx("div",{"data-testid":"rf__wrapper",...da,onScroll:Wt,style:{...Cs,...R7},ref:No,className:Ct(["react-flow",s,gf]),id:Ns,children:C.jsxs(M7,{nodes:e,edges:t,width:pf,height:To,fitView:pr,fitViewOptions:Fr,minZoom:Kn,maxZoom:se,nodeOrigin:Dn,nodeExtent:Te,children:[C.jsx(N7,{onInit:d,onNodeClick:c,onEdgeClick:f,onNodeMouseEnter:A,onNodeMouseMove:S,onNodeMouseLeave:O,onNodeContextMenu:D,onNodeDoubleClick:M,nodeTypes:l,edgeTypes:o,connectionLineType:te,connectionLineStyle:T,connectionLineComponent:V,connectionLineContainerStyle:K,selectionKeyCode:le,selectionOnDrag:fe,selectionMode:ye,deleteKeyCode:J,multiSelectionKeyCode:Se,panActivationKeyCode:Ae,zoomActivationKeyCode:be,onlyRenderVisibleElements:lt,defaultViewport:Ti,translateExtent:he,minZoom:Kn,maxZoom:se,preventScrolling:Ee,zoomOnScroll:Gt,zoomOnPinch:jn,zoomOnDoubleClick:wt,panOnScroll:Pt,panOnScrollSpeed:Sn,panOnScrollMode:Zt,panOnDrag:Kt,onPaneClick:un,onPaneMouseEnter:yo,onPaneMouseMove:bo,onPaneMouseLeave:_s,onPaneScroll:Ci,onPaneContextMenu:uf,paneClickDistance:Ss,nodeClickDistance:vo,onSelectionContextMenu:P,onSelectionStart:Y,onSelectionEnd:X,onReconnect:Es,onReconnectStart:xo,onReconnectEnd:cf,onEdgeContextMenu:Jn,onEdgeDoubleClick:Mt,onEdgeMouseEnter:Ut,onEdgeMouseMove:Br,onEdgeMouseLeave:As,reconnectRadius:ff,defaultMarkerColor:Qe,noDragClassName:Ni,noWheelClassName:Ts,noPanClassName:hr,rfId:$r,disableKeyboardA11y:ko,nodeExtent:Te,viewport:Os,onViewportChange:Ms}),C.jsx(hB,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:b,onConnectStart:x,onConnectEnd:w,onClickConnectStart:_,onClickConnectEnd:k,nodesDraggable:xt,nodesConnectable:Ai,nodesFocusable:fr,edgesFocusable:Xn,edgesReconnectable:dr,elementsSelectable:Qn,elevateNodesOnSelect:gr,elevateEdgesOnSelect:Ur,minZoom:Kn,maxZoom:se,nodeExtent:Te,onNodesChange:df,onEdgesChange:wo,snapToGrid:je,snapGrid:ze,connectionMode:G,translateExtent:he,connectOnClick:Pr,defaultEdgeOptions:So,fitView:pr,fitViewOptions:Fr,onNodesDelete:j,onEdgesDelete:H,onDelete:B,onNodeDragStart:F,onNodeDrag:L,onNodeDragStop:U,onSelectionDrag:$,onSelectionDragStart:R,onSelectionDragStop:I,onMove:p,onMoveStart:g,onMoveEnd:m,noPanClassName:hr,nodeOrigin:Dn,rfId:$r,autoPanOnConnect:Eo,autoPanOnNodeDrag:Ao,autoPanSpeed:hf,onError:zn,connectionRadius:ua,isValidConnection:ca,selectNodesOnDrag:ft,nodeDragThreshold:Hr,onBeforeDelete:E,paneClickDistance:Ss,debug:Co}),C.jsx(uB,{onSelectionChange:q}),ks,C.jsx(iB,{proOptions:_o,position:_t}),C.jsx(nB,{rfId:$r,disableKeyboardA11y:ko})]})})}var j7=OE(D7);function z7(e){const[t,n]=W.useState(e),r=W.useCallback(s=>n(l=>CE(s,l)),[]);return[t,n,r]}function L7(e){const[t,n]=W.useState(e),r=W.useCallback(s=>n(l=>NE(s,l)),[]);return[t,n,r]}function I7({dimensions:e,lineWidth:t,variant:n,className:r}){return C.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ct(["react-flow__background-pattern",n,r])})}function B7({radius:e,className:t}){return C.jsx("circle",{cx:e,cy:e,r:e,className:Ct(["react-flow__background-pattern","dots",t])})}var wi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(wi||(wi={}));const F7={[wi.Dots]:1,[wi.Lines]:1,[wi.Cross]:6},P7=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function t2({id:e,variant:t=wi.Dots,gap:n=20,size:r,lineWidth:s=1,offset:l=0,color:o,bgColor:c,style:f,className:d,patternClassName:p}){const g=W.useRef(null),{transform:m,patternId:b}=Ge(P7,yt),x=r||F7[t],w=t===wi.Dots,_=t===wi.Cross,k=Array.isArray(n)?n:[n,n],A=[k[0]*m[2]||1,k[1]*m[2]||1],S=x*m[2],O=Array.isArray(l)?l:[l,l],D=_?[S,S]:A,M=[O[0]*m[2]||1+D[0]/2,O[1]*m[2]||1+D[1]/2],F=`${b}${e||""}`;return C.jsxs("svg",{className:Ct(["react-flow__background",d]),style:{...f,...lf,"--xy-background-color-props":c,"--xy-background-pattern-color-props":o},ref:g,"data-testid":"rf__background",children:[C.jsx("pattern",{id:F,x:m[0]%A[0],y:m[1]%A[1],width:A[0],height:A[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${M[0]},-${M[1]})`,children:w?C.jsx(B7,{radius:S/2,className:p}):C.jsx(I7,{dimensions:D,lineWidth:s,variant:t,className:p})}),C.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${F})`})]})}t2.displayName="Background";const U7=W.memo(t2);function H7(){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:C.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function $7(){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:C.jsx("path",{d:"M0 0h32v4.2H0z"})})}function V7(){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:C.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function q7(){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:C.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function G7(){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:C.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function tc({children:e,className:t,...n}){return C.jsx("button",{type:"button",className:Ct(["react-flow__controls-button",t]),...n,children:e})}const Z7=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function n2({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:l,onZoomOut:o,onFitView:c,onInteractiveChange:f,className:d,children:p,position:g="bottom-left",orientation:m="vertical","aria-label":b="React Flow controls"}){const x=ht(),{isInteractive:w,minZoomReached:_,maxZoomReached:k}=Ge(Z7,yt),{zoomIn:A,zoomOut:S,fitView:O}=sf(),D=()=>{A(),l==null||l()},M=()=>{S(),o==null||o()},F=()=>{O(s),c==null||c()},L=()=>{x.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),f==null||f(!w)},U=m==="horizontal"?"horizontal":"vertical";return C.jsxs(mo,{className:Ct(["react-flow__controls",U,d]),position:g,style:e,"data-testid":"rf__controls","aria-label":b,children:[t&&C.jsxs(C.Fragment,{children:[C.jsx(tc,{onClick:D,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:k,children:C.jsx(H7,{})}),C.jsx(tc,{onClick:M,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:_,children:C.jsx($7,{})})]}),n&&C.jsx(tc,{className:"react-flow__controls-fitview",onClick:F,title:"fit view","aria-label":"fit view",children:C.jsx(V7,{})}),r&&C.jsx(tc,{className:"react-flow__controls-interactive",onClick:L,title:"toggle interactivity","aria-label":"toggle interactivity",children:w?C.jsx(G7,{}):C.jsx(q7,{})}),p]})}n2.displayName="Controls";const Y7=W.memo(n2);function X7({id:e,x:t,y:n,width:r,height:s,style:l,color:o,strokeColor:c,strokeWidth:f,className:d,borderRadius:p,shapeRendering:g,selected:m,onClick:b}){const{background:x,backgroundColor:w}=l||{},_=o||x||w;return C.jsx("rect",{className:Ct(["react-flow__minimap-node",{selected:m},d]),x:t,y:n,rx:p,ry:p,width:r,height:s,style:{fill:_,stroke:c,strokeWidth:f},shapeRendering:g,onClick:b?k=>b(k,e):void 0})}const Q7=W.memo(X7),K7=e=>e.nodes.map(t=>t.id),xp=e=>e instanceof Function?e:()=>e;function J7({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:l=Q7,onClick:o}){const c=Ge(K7,yt),f=xp(t),d=xp(e),p=xp(n),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return C.jsx(C.Fragment,{children:c.map(m=>C.jsx(eF,{id:m,nodeColorFunc:f,nodeStrokeColorFunc:d,nodeClassNameFunc:p,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:l,onClick:o,shapeRendering:g},m))})}function W7({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:l,shapeRendering:o,NodeComponent:c,onClick:f}){const{node:d,x:p,y:g,width:m,height:b}=Ge(x=>{const{internals:w}=x.nodeLookup.get(e),_=w.userNode,{x:k,y:A}=w.positionAbsolute,{width:S,height:O}=Ir(_);return{node:_,x:k,y:A,width:S,height:O}},yt);return!d||d.hidden||!rE(d)?null:C.jsx(c,{x:p,y:g,width:m,height:b,style:d.style,selected:!!d.selected,className:r(d),color:t(d),borderRadius:s,strokeColor:n(d),strokeWidth:l,shapeRendering:o,onClick:f,id:d.id})}const eF=W.memo(W7);var tF=W.memo(J7);const nF=200,rF=150,iF=e=>!e.hidden,aF=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?nE(po(e.nodeLookup,{filter:iF}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},sF="react-flow__minimap-desc";function r2({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:l=5,nodeStrokeWidth:o,nodeComponent:c,bgColor:f,maskColor:d,maskStrokeColor:p,maskStrokeWidth:g,position:m="bottom-right",onClick:b,onNodeClick:x,pannable:w=!1,zoomable:_=!1,ariaLabel:k="React Flow mini map",inversePan:A,zoomStep:S=10,offsetScale:O=5}){const D=ht(),M=W.useRef(null),{boundingRect:F,viewBB:L,rfId:U,panZoom:j,translateExtent:H,flowWidth:B,flowHeight:q}=Ge(aF,yt),R=(e==null?void 0:e.width)??nF,$=(e==null?void 0:e.height)??rF,I=F.width/R,P=F.height/$,Y=Math.max(I,P),X=Y*R,E=Y*$,G=O*Y,te=F.x-(X-F.width)/2-G,T=F.y-(E-F.height)/2-G,V=X+G*2,K=E+G*2,J=`${sF}-${U}`,le=W.useRef(0),fe=W.useRef();le.current=Y,W.useEffect(()=>{if(M.current&&j)return fe.current=S8({domNode:M.current,panZoom:j,getTransform:()=>D.getState().transform,getViewScale:()=>le.current}),()=>{var Se;(Se=fe.current)==null||Se.destroy()}},[j]),W.useEffect(()=>{var Se;(Se=fe.current)==null||Se.update({translateExtent:H,width:B,height:q,inversePan:A,pannable:w,zoomStep:S,zoomable:_})},[w,_,A,S,H,B,q]);const ye=b?Se=>{var ze;const[be,je]=((ze=fe.current)==null?void 0:ze.pointer(Se))||[0,0];b(Se,{x:be,y:je})}:void 0,Ae=x?W.useCallback((Se,be)=>{const je=D.getState().nodeLookup.get(be).internals.userNode;x(Se,je)},[]):void 0;return C.jsx(mo,{position:m,style:{...e,"--xy-minimap-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*Y:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:Ct(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:C.jsxs("svg",{width:R,height:$,viewBox:`${te} ${T} ${V} ${K}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":J,ref:M,onClick:ye,children:[k&&C.jsx("title",{id:J,children:k}),C.jsx(tF,{onClick:Ae,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:l,nodeClassName:s,nodeStrokeWidth:o,nodeComponent:c}),C.jsx("path",{className:"react-flow__minimap-mask",d:`M${te-G},${T-G}h${V+G*2}v${K+G*2}h${-V-G*2}z
|
|
244
|
-
M${L.x},${L.y}h${L.width}v${L.height}h${-L.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}r2.displayName="MiniMap";W.memo(r2);function lF({nodeId:e,position:t,variant:n=$l.Handle,className:r,style:s={},children:l,color:o,minWidth:c=10,minHeight:f=10,maxWidth:d=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:m,shouldResize:b,onResizeStart:x,onResize:w,onResizeEnd:_}){const k=jE(),A=typeof e=="string"?e:k,S=ht(),O=W.useRef(null),D=n===$l.Line?"right":"bottom-right",M=t??D,F=W.useRef(null);W.useEffect(()=>{if(!(!O.current||!A))return F.current||(F.current=B8({domNode:O.current,nodeId:A,getStoreItems:()=>{const{nodeLookup:H,transform:B,snapGrid:q,snapToGrid:R,nodeOrigin:$,domNode:I}=S.getState();return{nodeLookup:H,transform:B,snapGrid:q,snapToGrid:R,nodeOrigin:$,paneDomNode:I}},onChange:(H,B)=>{const{triggerNodeChanges:q,nodeLookup:R,parentLookup:$,nodeOrigin:I}=S.getState(),P=[],Y={x:H.x,y:H.y},X=R.get(A);if(X&&X.expandParent&&X.parentId){const E=X.origin??I,G=H.width??X.measured.width??0,te=H.height??X.measured.height??0,T={id:X.id,parentId:X.parentId,rect:{width:G,height:te,...iE({x:H.x??X.position.x,y:H.y??X.position.y},{width:G,height:te},X.parentId,R,E)}},V=Pm([T],R,$,I);P.push(...V),Y.x=H.x?Math.max(E[0]*G,H.x):void 0,Y.y=H.y?Math.max(E[1]*te,H.y):void 0}if(Y.x!==void 0&&Y.y!==void 0){const E={id:A,type:"position",position:{...Y}};P.push(E)}if(H.width!==void 0&&H.height!==void 0){const G={id:A,type:"dimensions",resizing:!0,setAttributes:m?m==="horizontal"?"width":"height":!0,dimensions:{width:H.width,height:H.height}};P.push(G)}for(const E of B){const G={...E,type:"position"};P.push(G)}q(P)},onEnd:({width:H,height:B})=>{const q={id:A,type:"dimensions",resizing:!1,dimensions:{width:H,height:B}};S.getState().triggerNodeChanges([q])}})),F.current.update({controlPosition:M,boundaries:{minWidth:c,minHeight:f,maxWidth:d,maxHeight:p},keepAspectRatio:g,resizeDirection:m,onResizeStart:x,onResize:w,onResizeEnd:_,shouldResize:b}),()=>{var H;(H=F.current)==null||H.destroy()}},[M,c,f,d,p,g,x,w,_,b]);const L=M.split("-"),U=n===$l.Line?"borderColor":"backgroundColor",j=o?{...s,[U]:o}:s;return C.jsx("div",{className:Ct(["react-flow__resize-control","nodrag",...L,n,r]),ref:O,style:j,children:l})}W.memo(lF);var wp,Nw;function Hm(){if(Nw)return wp;Nw=1;var e="\0",t="\0",n="";class r{constructor(p){ut(this,"_isDirected",!0);ut(this,"_isMultigraph",!1);ut(this,"_isCompound",!1);ut(this,"_label");ut(this,"_defaultNodeLabelFn",()=>{});ut(this,"_defaultEdgeLabelFn",()=>{});ut(this,"_nodes",{});ut(this,"_in",{});ut(this,"_preds",{});ut(this,"_out",{});ut(this,"_sucs",{});ut(this,"_edgeObjs",{});ut(this,"_edgeLabels",{});ut(this,"_nodeCount",0);ut(this,"_edgeCount",0);ut(this,"_parent");ut(this,"_children");p&&(this._isDirected=Object.hasOwn(p,"directed")?p.directed:!0,this._isMultigraph=Object.hasOwn(p,"multigraph")?p.multigraph:!1,this._isCompound=Object.hasOwn(p,"compound")?p.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[t]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(p){return this._label=p,this}graph(){return this._label}setDefaultNodeLabel(p){return this._defaultNodeLabelFn=p,typeof p!="function"&&(this._defaultNodeLabelFn=()=>p),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var p=this;return this.nodes().filter(g=>Object.keys(p._in[g]).length===0)}sinks(){var p=this;return this.nodes().filter(g=>Object.keys(p._out[g]).length===0)}setNodes(p,g){var m=arguments,b=this;return p.forEach(function(x){m.length>1?b.setNode(x,g):b.setNode(x)}),this}setNode(p,g){return Object.hasOwn(this._nodes,p)?(arguments.length>1&&(this._nodes[p]=g),this):(this._nodes[p]=arguments.length>1?g:this._defaultNodeLabelFn(p),this._isCompound&&(this._parent[p]=t,this._children[p]={},this._children[t][p]=!0),this._in[p]={},this._preds[p]={},this._out[p]={},this._sucs[p]={},++this._nodeCount,this)}node(p){return this._nodes[p]}hasNode(p){return Object.hasOwn(this._nodes,p)}removeNode(p){var g=this;if(Object.hasOwn(this._nodes,p)){var m=b=>g.removeEdge(g._edgeObjs[b]);delete this._nodes[p],this._isCompound&&(this._removeFromParentsChildList(p),delete this._parent[p],this.children(p).forEach(function(b){g.setParent(b)}),delete this._children[p]),Object.keys(this._in[p]).forEach(m),delete this._in[p],delete this._preds[p],Object.keys(this._out[p]).forEach(m),delete this._out[p],delete this._sucs[p],--this._nodeCount}return this}setParent(p,g){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(g===void 0)g=t;else{g+="";for(var m=g;m!==void 0;m=this.parent(m))if(m===p)throw new Error("Setting "+g+" as parent of "+p+" would create a cycle");this.setNode(g)}return this.setNode(p),this._removeFromParentsChildList(p),this._parent[p]=g,this._children[g][p]=!0,this}_removeFromParentsChildList(p){delete this._children[this._parent[p]][p]}parent(p){if(this._isCompound){var g=this._parent[p];if(g!==t)return g}}children(p=t){if(this._isCompound){var g=this._children[p];if(g)return Object.keys(g)}else{if(p===t)return this.nodes();if(this.hasNode(p))return[]}}predecessors(p){var g=this._preds[p];if(g)return Object.keys(g)}successors(p){var g=this._sucs[p];if(g)return Object.keys(g)}neighbors(p){var g=this.predecessors(p);if(g){const b=new Set(g);for(var m of this.successors(p))b.add(m);return Array.from(b.values())}}isLeaf(p){var g;return this.isDirected()?g=this.successors(p):g=this.neighbors(p),g.length===0}filterNodes(p){var g=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});g.setGraph(this.graph());var m=this;Object.entries(this._nodes).forEach(function([w,_]){p(w)&&g.setNode(w,_)}),Object.values(this._edgeObjs).forEach(function(w){g.hasNode(w.v)&&g.hasNode(w.w)&&g.setEdge(w,m.edge(w))});var b={};function x(w){var _=m.parent(w);return _===void 0||g.hasNode(_)?(b[w]=_,_):_ in b?b[_]:x(_)}return this._isCompound&&g.nodes().forEach(w=>g.setParent(w,x(w))),g}setDefaultEdgeLabel(p){return this._defaultEdgeLabelFn=p,typeof p!="function"&&(this._defaultEdgeLabelFn=()=>p),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(p,g){var m=this,b=arguments;return p.reduce(function(x,w){return b.length>1?m.setEdge(x,w,g):m.setEdge(x,w),w}),this}setEdge(){var p,g,m,b,x=!1,w=arguments[0];typeof w=="object"&&w!==null&&"v"in w?(p=w.v,g=w.w,m=w.name,arguments.length===2&&(b=arguments[1],x=!0)):(p=w,g=arguments[1],m=arguments[3],arguments.length>2&&(b=arguments[2],x=!0)),p=""+p,g=""+g,m!==void 0&&(m=""+m);var _=o(this._isDirected,p,g,m);if(Object.hasOwn(this._edgeLabels,_))return x&&(this._edgeLabels[_]=b),this;if(m!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(p),this.setNode(g),this._edgeLabels[_]=x?b:this._defaultEdgeLabelFn(p,g,m);var k=c(this._isDirected,p,g,m);return p=k.v,g=k.w,Object.freeze(k),this._edgeObjs[_]=k,s(this._preds[g],p),s(this._sucs[p],g),this._in[g][_]=k,this._out[p][_]=k,this._edgeCount++,this}edge(p,g,m){var b=arguments.length===1?f(this._isDirected,arguments[0]):o(this._isDirected,p,g,m);return this._edgeLabels[b]}edgeAsObj(){const p=this.edge(...arguments);return typeof p!="object"?{label:p}:p}hasEdge(p,g,m){var b=arguments.length===1?f(this._isDirected,arguments[0]):o(this._isDirected,p,g,m);return Object.hasOwn(this._edgeLabels,b)}removeEdge(p,g,m){var b=arguments.length===1?f(this._isDirected,arguments[0]):o(this._isDirected,p,g,m),x=this._edgeObjs[b];return x&&(p=x.v,g=x.w,delete this._edgeLabels[b],delete this._edgeObjs[b],l(this._preds[g],p),l(this._sucs[p],g),delete this._in[g][b],delete this._out[p][b],this._edgeCount--),this}inEdges(p,g){var m=this._in[p];if(m){var b=Object.values(m);return g?b.filter(x=>x.v===g):b}}outEdges(p,g){var m=this._out[p];if(m){var b=Object.values(m);return g?b.filter(x=>x.w===g):b}}nodeEdges(p,g){var m=this.inEdges(p,g);if(m)return m.concat(this.outEdges(p,g))}}function s(d,p){d[p]?d[p]++:d[p]=1}function l(d,p){--d[p]||delete d[p]}function o(d,p,g,m){var b=""+p,x=""+g;if(!d&&b>x){var w=b;b=x,x=w}return b+n+x+n+(m===void 0?e:m)}function c(d,p,g,m){var b=""+p,x=""+g;if(!d&&b>x){var w=b;b=x,x=w}var _={v:b,w:x};return m&&(_.name=m),_}function f(d,p){return o(d,p.v,p.w,p.name)}return wp=r,wp}var _p,Ow;function oF(){return Ow||(Ow=1,_p="2.2.4"),_p}var Sp,Mw;function uF(){return Mw||(Mw=1,Sp={Graph:Hm(),version:oF()}),Sp}var kp,Rw;function cF(){if(Rw)return kp;Rw=1;var e=Hm();kp={write:t,read:s};function t(l){var o={options:{directed:l.isDirected(),multigraph:l.isMultigraph(),compound:l.isCompound()},nodes:n(l),edges:r(l)};return l.graph()!==void 0&&(o.value=structuredClone(l.graph())),o}function n(l){return l.nodes().map(function(o){var c=l.node(o),f=l.parent(o),d={v:o};return c!==void 0&&(d.value=c),f!==void 0&&(d.parent=f),d})}function r(l){return l.edges().map(function(o){var c=l.edge(o),f={v:o.v,w:o.w};return o.name!==void 0&&(f.name=o.name),c!==void 0&&(f.value=c),f})}function s(l){var o=new e(l.options).setGraph(l.value);return l.nodes.forEach(function(c){o.setNode(c.v,c.value),c.parent&&o.setParent(c.v,c.parent)}),l.edges.forEach(function(c){o.setEdge({v:c.v,w:c.w,name:c.name},c.value)}),o}return kp}var Ep,Dw;function fF(){if(Dw)return Ep;Dw=1,Ep=e;function e(t){var n={},r=[],s;function l(o){Object.hasOwn(n,o)||(n[o]=!0,s.push(o),t.successors(o).forEach(l),t.predecessors(o).forEach(l))}return t.nodes().forEach(function(o){s=[],l(o),s.length&&r.push(s)}),r}return Ep}var Ap,jw;function i2(){if(jw)return Ap;jw=1;class e{constructor(){ut(this,"_arr",[]);ut(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(n){return n.key})}has(n){return Object.hasOwn(this._keyIndices,n)}priority(n){var r=this._keyIndices[n];if(r!==void 0)return this._arr[r].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(n,r){var s=this._keyIndices;if(n=String(n),!Object.hasOwn(s,n)){var l=this._arr,o=l.length;return s[n]=o,l.push({key:n,priority:r}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key}decrease(n,r){var s=this._keyIndices[n];if(r>this._arr[s].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[s].priority+" New: "+r);this._arr[s].priority=r,this._decrease(s)}_heapify(n){var r=this._arr,s=2*n,l=s+1,o=n;s<r.length&&(o=r[s].priority<r[o].priority?s:o,l<r.length&&(o=r[l].priority<r[o].priority?l:o),o!==n&&(this._swap(n,o),this._heapify(o)))}_decrease(n){for(var r=this._arr,s=r[n].priority,l;n!==0&&(l=n>>1,!(r[l].priority<s));)this._swap(n,l),n=l}_swap(n,r){var s=this._arr,l=this._keyIndices,o=s[n],c=s[r];s[n]=c,s[r]=o,l[c.key]=n,l[o.key]=r}}return Ap=e,Ap}var Tp,zw;function a2(){if(zw)return Tp;zw=1;var e=i2();Tp=n;var t=()=>1;function n(s,l,o,c){return r(s,String(l),o||t,c||function(f){return s.outEdges(f)})}function r(s,l,o,c){var f={},d=new e,p,g,m=function(b){var x=b.v!==p?b.v:b.w,w=f[x],_=o(b),k=g.distance+_;if(_<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+b+" Weight: "+_);k<w.distance&&(w.distance=k,w.predecessor=p,d.decrease(x,k))};for(s.nodes().forEach(function(b){var x=b===l?0:Number.POSITIVE_INFINITY;f[b]={distance:x},d.add(b,x)});d.size()>0&&(p=d.removeMin(),g=f[p],g.distance!==Number.POSITIVE_INFINITY);)c(p).forEach(m);return f}return Tp}var Cp,Lw;function dF(){if(Lw)return Cp;Lw=1;var e=a2();Cp=t;function t(n,r,s){return n.nodes().reduce(function(l,o){return l[o]=e(n,o,r,s),l},{})}return Cp}var Np,Iw;function s2(){if(Iw)return Np;Iw=1,Np=e;function e(t){var n=0,r=[],s={},l=[];function o(c){var f=s[c]={onStack:!0,lowlink:n,index:n++};if(r.push(c),t.successors(c).forEach(function(g){Object.hasOwn(s,g)?s[g].onStack&&(f.lowlink=Math.min(f.lowlink,s[g].index)):(o(g),f.lowlink=Math.min(f.lowlink,s[g].lowlink))}),f.lowlink===f.index){var d=[],p;do p=r.pop(),s[p].onStack=!1,d.push(p);while(c!==p);l.push(d)}}return t.nodes().forEach(function(c){Object.hasOwn(s,c)||o(c)}),l}return Np}var Op,Bw;function hF(){if(Bw)return Op;Bw=1;var e=s2();Op=t;function t(n){return e(n).filter(function(r){return r.length>1||r.length===1&&n.hasEdge(r[0],r[0])})}return Op}var Mp,Fw;function pF(){if(Fw)return Mp;Fw=1,Mp=t;var e=()=>1;function t(r,s,l){return n(r,s||e,l||function(o){return r.outEdges(o)})}function n(r,s,l){var o={},c=r.nodes();return c.forEach(function(f){o[f]={},o[f][f]={distance:0},c.forEach(function(d){f!==d&&(o[f][d]={distance:Number.POSITIVE_INFINITY})}),l(f).forEach(function(d){var p=d.v===f?d.w:d.v,g=s(d);o[f][p]={distance:g,predecessor:f}})}),c.forEach(function(f){var d=o[f];c.forEach(function(p){var g=o[p];c.forEach(function(m){var b=g[f],x=d[m],w=g[m],_=b.distance+x.distance;_<w.distance&&(w.distance=_,w.predecessor=x.predecessor)})})}),o}return Mp}var Rp,Pw;function l2(){if(Pw)return Rp;Pw=1;function e(n){var r={},s={},l=[];function o(c){if(Object.hasOwn(s,c))throw new t;Object.hasOwn(r,c)||(s[c]=!0,r[c]=!0,n.predecessors(c).forEach(o),delete s[c],l.push(c))}if(n.sinks().forEach(o),Object.keys(r).length!==n.nodeCount())throw new t;return l}class t extends Error{constructor(){super(...arguments)}}return Rp=e,e.CycleException=t,Rp}var Dp,Uw;function gF(){if(Uw)return Dp;Uw=1;var e=l2();Dp=t;function t(n){try{e(n)}catch(r){if(r instanceof e.CycleException)return!1;throw r}return!0}return Dp}var jp,Hw;function o2(){if(Hw)return jp;Hw=1,jp=e;function e(s,l,o){Array.isArray(l)||(l=[l]);var c=s.isDirected()?g=>s.successors(g):g=>s.neighbors(g),f=o==="post"?t:n,d=[],p={};return l.forEach(g=>{if(!s.hasNode(g))throw new Error("Graph does not have node: "+g);f(g,c,p,d)}),d}function t(s,l,o,c){for(var f=[[s,!1]];f.length>0;){var d=f.pop();d[1]?c.push(d[0]):Object.hasOwn(o,d[0])||(o[d[0]]=!0,f.push([d[0],!0]),r(l(d[0]),p=>f.push([p,!1])))}}function n(s,l,o,c){for(var f=[s];f.length>0;){var d=f.pop();Object.hasOwn(o,d)||(o[d]=!0,c.push(d),r(l(d),p=>f.push(p)))}}function r(s,l){for(var o=s.length;o--;)l(s[o],o,s);return s}return jp}var zp,$w;function mF(){if($w)return zp;$w=1;var e=o2();zp=t;function t(n,r){return e(n,r,"post")}return zp}var Lp,Vw;function yF(){if(Vw)return Lp;Vw=1;var e=o2();Lp=t;function t(n,r){return e(n,r,"pre")}return Lp}var Ip,qw;function bF(){if(qw)return Ip;qw=1;var e=Hm(),t=i2();Ip=n;function n(r,s){var l=new e,o={},c=new t,f;function d(g){var m=g.v===f?g.w:g.v,b=c.priority(m);if(b!==void 0){var x=s(g);x<b&&(o[m]=f,c.decrease(m,x))}}if(r.nodeCount()===0)return l;r.nodes().forEach(function(g){c.add(g,Number.POSITIVE_INFINITY),l.setNode(g)}),c.decrease(r.nodes()[0],0);for(var p=!1;c.size()>0;){if(f=c.removeMin(),Object.hasOwn(o,f))l.setEdge(f,o[f]);else{if(p)throw new Error("Input graph is not connected: "+r);p=!0}r.nodeEdges(f).forEach(d)}return l}return Ip}var Bp,Gw;function vF(){return Gw||(Gw=1,Bp={components:fF(),dijkstra:a2(),dijkstraAll:dF(),findCycles:hF(),floydWarshall:pF(),isAcyclic:gF(),postorder:mF(),preorder:yF(),prim:bF(),tarjan:s2(),topsort:l2()}),Bp}var Fp,Zw;function Zn(){if(Zw)return Fp;Zw=1;var e=uF();return Fp={Graph:e.Graph,json:cF(),alg:vF(),version:e.version},Fp}var Pp,Yw;function xF(){if(Yw)return Pp;Yw=1;class e{constructor(){let s={};s._next=s._prev=s,this._sentinel=s}dequeue(){let s=this._sentinel,l=s._prev;if(l!==s)return t(l),l}enqueue(s){let l=this._sentinel;s._prev&&s._next&&t(s),s._next=l._next,l._next._prev=s,l._next=s,s._prev=l}toString(){let s=[],l=this._sentinel,o=l._prev;for(;o!==l;)s.push(JSON.stringify(o,n)),o=o._prev;return"["+s.join(", ")+"]"}}function t(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function n(r,s){if(r!=="_next"&&r!=="_prev")return s}return Pp=e,Pp}var Up,Xw;function wF(){if(Xw)return Up;Xw=1;let e=Zn().Graph,t=xF();Up=r;let n=()=>1;function r(d,p){if(d.nodeCount()<=1)return[];let g=o(d,p||n);return s(g.graph,g.buckets,g.zeroIdx).flatMap(b=>d.outEdges(b.v,b.w))}function s(d,p,g){let m=[],b=p[p.length-1],x=p[0],w;for(;d.nodeCount();){for(;w=x.dequeue();)l(d,p,g,w);for(;w=b.dequeue();)l(d,p,g,w);if(d.nodeCount()){for(let _=p.length-2;_>0;--_)if(w=p[_].dequeue(),w){m=m.concat(l(d,p,g,w,!0));break}}}return m}function l(d,p,g,m,b){let x=b?[]:void 0;return d.inEdges(m.v).forEach(w=>{let _=d.edge(w),k=d.node(w.v);b&&x.push({v:w.v,w:w.w}),k.out-=_,c(p,g,k)}),d.outEdges(m.v).forEach(w=>{let _=d.edge(w),k=w.w,A=d.node(k);A.in-=_,c(p,g,A)}),d.removeNode(m.v),x}function o(d,p){let g=new e,m=0,b=0;d.nodes().forEach(_=>{g.setNode(_,{v:_,in:0,out:0})}),d.edges().forEach(_=>{let k=g.edge(_.v,_.w)||0,A=p(_),S=k+A;g.setEdge(_.v,_.w,S),b=Math.max(b,g.node(_.v).out+=A),m=Math.max(m,g.node(_.w).in+=A)});let x=f(b+m+3).map(()=>new t),w=m+1;return g.nodes().forEach(_=>{c(x,w,g.node(_))}),{graph:g,buckets:x,zeroIdx:w}}function c(d,p,g){g.out?g.in?d[g.out-g.in+p].enqueue(g):d[d.length-1].enqueue(g):d[0].enqueue(g)}function f(d){const p=[];for(let g=0;g<d;g++)p.push(g);return p}return Up}var Hp,Qw;function Tt(){if(Qw)return Hp;Qw=1;let e=Zn().Graph;Hp={addBorderNode:p,addDummyNode:t,applyWithChunking:b,asNonCompoundGraph:r,buildLayerMatrix:c,intersectRect:o,mapValues:M,maxRank:x,normalizeRanks:f,notime:k,partition:w,pick:D,predecessorWeights:l,range:O,removeEmptyRanks:d,simplify:n,successorWeights:s,time:_,uniqueId:S,zipObject:F};function t(L,U,j,H){let B;do B=S(H);while(L.hasNode(B));return j.dummy=U,L.setNode(B,j),B}function n(L){let U=new e().setGraph(L.graph());return L.nodes().forEach(j=>U.setNode(j,L.node(j))),L.edges().forEach(j=>{let H=U.edge(j.v,j.w)||{weight:0,minlen:1},B=L.edge(j);U.setEdge(j.v,j.w,{weight:H.weight+B.weight,minlen:Math.max(H.minlen,B.minlen)})}),U}function r(L){let U=new e({multigraph:L.isMultigraph()}).setGraph(L.graph());return L.nodes().forEach(j=>{L.children(j).length||U.setNode(j,L.node(j))}),L.edges().forEach(j=>{U.setEdge(j,L.edge(j))}),U}function s(L){let U=L.nodes().map(j=>{let H={};return L.outEdges(j).forEach(B=>{H[B.w]=(H[B.w]||0)+L.edge(B).weight}),H});return F(L.nodes(),U)}function l(L){let U=L.nodes().map(j=>{let H={};return L.inEdges(j).forEach(B=>{H[B.v]=(H[B.v]||0)+L.edge(B).weight}),H});return F(L.nodes(),U)}function o(L,U){let j=L.x,H=L.y,B=U.x-j,q=U.y-H,R=L.width/2,$=L.height/2;if(!B&&!q)throw new Error("Not possible to find intersection inside of the rectangle");let I,P;return Math.abs(q)*R>Math.abs(B)*$?(q<0&&($=-$),I=$*B/q,P=$):(B<0&&(R=-R),I=R,P=R*q/B),{x:j+I,y:H+P}}function c(L){let U=O(x(L)+1).map(()=>[]);return L.nodes().forEach(j=>{let H=L.node(j),B=H.rank;B!==void 0&&(U[B][H.order]=j)}),U}function f(L){let U=L.nodes().map(H=>{let B=L.node(H).rank;return B===void 0?Number.MAX_VALUE:B}),j=b(Math.min,U);L.nodes().forEach(H=>{let B=L.node(H);Object.hasOwn(B,"rank")&&(B.rank-=j)})}function d(L){let U=L.nodes().map(R=>L.node(R).rank),j=b(Math.min,U),H=[];L.nodes().forEach(R=>{let $=L.node(R).rank-j;H[$]||(H[$]=[]),H[$].push(R)});let B=0,q=L.graph().nodeRankFactor;Array.from(H).forEach((R,$)=>{R===void 0&&$%q!==0?--B:R!==void 0&&B&&R.forEach(I=>L.node(I).rank+=B)})}function p(L,U,j,H){let B={width:0,height:0};return arguments.length>=4&&(B.rank=j,B.order=H),t(L,"border",B,U)}function g(L,U=m){const j=[];for(let H=0;H<L.length;H+=U){const B=L.slice(H,H+U);j.push(B)}return j}const m=65535;function b(L,U){if(U.length>m){const j=g(U);return L.apply(null,j.map(H=>L.apply(null,H)))}else return L.apply(null,U)}function x(L){const j=L.nodes().map(H=>{let B=L.node(H).rank;return B===void 0?Number.MIN_VALUE:B});return b(Math.max,j)}function w(L,U){let j={lhs:[],rhs:[]};return L.forEach(H=>{U(H)?j.lhs.push(H):j.rhs.push(H)}),j}function _(L,U){let j=Date.now();try{return U()}finally{console.log(L+" time: "+(Date.now()-j)+"ms")}}function k(L,U){return U()}let A=0;function S(L){var U=++A;return toString(L)+U}function O(L,U,j=1){U==null&&(U=L,L=0);let H=q=>q<U;j<0&&(H=q=>U<q);const B=[];for(let q=L;H(q);q+=j)B.push(q);return B}function D(L,U){const j={};for(const H of U)L[H]!==void 0&&(j[H]=L[H]);return j}function M(L,U){let j=U;return typeof U=="string"&&(j=H=>H[U]),Object.entries(L).reduce((H,[B,q])=>(H[B]=j(q,B),H),{})}function F(L,U){return L.reduce((j,H,B)=>(j[H]=U[B],j),{})}return Hp}var $p,Kw;function _F(){if(Kw)return $p;Kw=1;let e=wF(),t=Tt().uniqueId;$p={run:n,undo:s};function n(l){(l.graph().acyclicer==="greedy"?e(l,c(l)):r(l)).forEach(f=>{let d=l.edge(f);l.removeEdge(f),d.forwardName=f.name,d.reversed=!0,l.setEdge(f.w,f.v,d,t("rev"))});function c(f){return d=>f.edge(d).weight}}function r(l){let o=[],c={},f={};function d(p){Object.hasOwn(f,p)||(f[p]=!0,c[p]=!0,l.outEdges(p).forEach(g=>{Object.hasOwn(c,g.w)?o.push(g):d(g.w)}),delete c[p])}return l.nodes().forEach(d),o}function s(l){l.edges().forEach(o=>{let c=l.edge(o);if(c.reversed){l.removeEdge(o);let f=c.forwardName;delete c.reversed,delete c.forwardName,l.setEdge(o.w,o.v,c,f)}})}return $p}var Vp,Jw;function SF(){if(Jw)return Vp;Jw=1;let e=Tt();Vp={run:t,undo:r};function t(s){s.graph().dummyChains=[],s.edges().forEach(l=>n(s,l))}function n(s,l){let o=l.v,c=s.node(o).rank,f=l.w,d=s.node(f).rank,p=l.name,g=s.edge(l),m=g.labelRank;if(d===c+1)return;s.removeEdge(l);let b,x,w;for(w=0,++c;c<d;++w,++c)g.points=[],x={width:0,height:0,edgeLabel:g,edgeObj:l,rank:c},b=e.addDummyNode(s,"edge",x,"_d"),c===m&&(x.width=g.width,x.height=g.height,x.dummy="edge-label",x.labelpos=g.labelpos),s.setEdge(o,b,{weight:g.weight},p),w===0&&s.graph().dummyChains.push(b),o=b;s.setEdge(o,f,{weight:g.weight},p)}function r(s){s.graph().dummyChains.forEach(l=>{let o=s.node(l),c=o.edgeLabel,f;for(s.setEdge(o.edgeObj,c);o.dummy;)f=s.successors(l)[0],s.removeNode(l),c.points.push({x:o.x,y:o.y}),o.dummy==="edge-label"&&(c.x=o.x,c.y=o.y,c.width=o.width,c.height=o.height),l=f,o=s.node(l)})}return Vp}var qp,Ww;function Lc(){if(Ww)return qp;Ww=1;const{applyWithChunking:e}=Tt();qp={longestPath:t,slack:n};function t(r){var s={};function l(o){var c=r.node(o);if(Object.hasOwn(s,o))return c.rank;s[o]=!0;let f=r.outEdges(o).map(p=>p==null?Number.POSITIVE_INFINITY:l(p.w)-r.edge(p).minlen);var d=e(Math.min,f);return d===Number.POSITIVE_INFINITY&&(d=0),c.rank=d}r.sources().forEach(l)}function n(r,s){return r.node(s.w).rank-r.node(s.v).rank-r.edge(s).minlen}return qp}var Gp,e_;function u2(){if(e_)return Gp;e_=1;var e=Zn().Graph,t=Lc().slack;Gp=n;function n(o){var c=new e({directed:!1}),f=o.nodes()[0],d=o.nodeCount();c.setNode(f,{});for(var p,g;r(c,o)<d;)p=s(c,o),g=c.hasNode(p.v)?t(o,p):-t(o,p),l(c,o,g);return c}function r(o,c){function f(d){c.nodeEdges(d).forEach(p=>{var g=p.v,m=d===g?p.w:g;!o.hasNode(m)&&!t(c,p)&&(o.setNode(m,{}),o.setEdge(d,m,{}),f(m))})}return o.nodes().forEach(f),o.nodeCount()}function s(o,c){return c.edges().reduce((d,p)=>{let g=Number.POSITIVE_INFINITY;return o.hasNode(p.v)!==o.hasNode(p.w)&&(g=t(c,p)),g<d[0]?[g,p]:d},[Number.POSITIVE_INFINITY,null])[1]}function l(o,c,f){o.nodes().forEach(d=>c.node(d).rank+=f)}return Gp}var Zp,t_;function kF(){if(t_)return Zp;t_=1;var e=u2(),t=Lc().slack,n=Lc().longestPath,r=Zn().alg.preorder,s=Zn().alg.postorder,l=Tt().simplify;Zp=o,o.initLowLimValues=p,o.initCutValues=c,o.calcCutValue=d,o.leaveEdge=m,o.enterEdge=b,o.exchangeEdges=x;function o(A){A=l(A),n(A);var S=e(A);p(S),c(S,A);for(var O,D;O=m(S);)D=b(S,A,O),x(S,A,O,D)}function c(A,S){var O=s(A,A.nodes());O=O.slice(0,O.length-1),O.forEach(D=>f(A,S,D))}function f(A,S,O){var D=A.node(O),M=D.parent;A.edge(O,M).cutvalue=d(A,S,O)}function d(A,S,O){var D=A.node(O),M=D.parent,F=!0,L=S.edge(O,M),U=0;return L||(F=!1,L=S.edge(M,O)),U=L.weight,S.nodeEdges(O).forEach(j=>{var H=j.v===O,B=H?j.w:j.v;if(B!==M){var q=H===F,R=S.edge(j).weight;if(U+=q?R:-R,_(A,O,B)){var $=A.edge(O,B).cutvalue;U+=q?-$:$}}}),U}function p(A,S){arguments.length<2&&(S=A.nodes()[0]),g(A,{},1,S)}function g(A,S,O,D,M){var F=O,L=A.node(D);return S[D]=!0,A.neighbors(D).forEach(U=>{Object.hasOwn(S,U)||(O=g(A,S,O,U,D))}),L.low=F,L.lim=O++,M?L.parent=M:delete L.parent,O}function m(A){return A.edges().find(S=>A.edge(S).cutvalue<0)}function b(A,S,O){var D=O.v,M=O.w;S.hasEdge(D,M)||(D=O.w,M=O.v);var F=A.node(D),L=A.node(M),U=F,j=!1;F.lim>L.lim&&(U=L,j=!0);var H=S.edges().filter(B=>j===k(A,A.node(B.v),U)&&j!==k(A,A.node(B.w),U));return H.reduce((B,q)=>t(S,q)<t(S,B)?q:B)}function x(A,S,O,D){var M=O.v,F=O.w;A.removeEdge(M,F),A.setEdge(D.v,D.w,{}),p(A),c(A,S),w(A,S)}function w(A,S){var O=A.nodes().find(M=>!S.node(M).parent),D=r(A,O);D=D.slice(1),D.forEach(M=>{var F=A.node(M).parent,L=S.edge(M,F),U=!1;L||(L=S.edge(F,M),U=!0),S.node(M).rank=S.node(F).rank+(U?L.minlen:-L.minlen)})}function _(A,S,O){return A.hasEdge(S,O)}function k(A,S,O){return O.low<=S.lim&&S.lim<=O.lim}return Zp}var Yp,n_;function EF(){if(n_)return Yp;n_=1;var e=Lc(),t=e.longestPath,n=u2(),r=kF();Yp=s;function s(f){switch(f.graph().ranker){case"network-simplex":c(f);break;case"tight-tree":o(f);break;case"longest-path":l(f);break;default:c(f)}}var l=t;function o(f){t(f),n(f)}function c(f){r(f)}return Yp}var Xp,r_;function AF(){if(r_)return Xp;r_=1,Xp=e;function e(r){let s=n(r);r.graph().dummyChains.forEach(l=>{let o=r.node(l),c=o.edgeObj,f=t(r,s,c.v,c.w),d=f.path,p=f.lca,g=0,m=d[g],b=!0;for(;l!==c.w;){if(o=r.node(l),b){for(;(m=d[g])!==p&&r.node(m).maxRank<o.rank;)g++;m===p&&(b=!1)}if(!b){for(;g<d.length-1&&r.node(m=d[g+1]).minRank<=o.rank;)g++;m=d[g]}r.setParent(l,m),l=r.successors(l)[0]}})}function t(r,s,l,o){let c=[],f=[],d=Math.min(s[l].low,s[o].low),p=Math.max(s[l].lim,s[o].lim),g,m;g=l;do g=r.parent(g),c.push(g);while(g&&(s[g].low>d||p>s[g].lim));for(m=g,g=o;(g=r.parent(g))!==m;)f.push(g);return{path:c.concat(f.reverse()),lca:m}}function n(r){let s={},l=0;function o(c){let f=l;r.children(c).forEach(o),s[c]={low:f,lim:l++}}return r.children().forEach(o),s}return Xp}var Qp,i_;function TF(){if(i_)return Qp;i_=1;let e=Tt();Qp={run:t,cleanup:l};function t(o){let c=e.addDummyNode(o,"root",{},"_root"),f=r(o),d=Object.values(f),p=e.applyWithChunking(Math.max,d)-1,g=2*p+1;o.graph().nestingRoot=c,o.edges().forEach(b=>o.edge(b).minlen*=g);let m=s(o)+1;o.children().forEach(b=>n(o,c,g,m,p,f,b)),o.graph().nodeRankFactor=g}function n(o,c,f,d,p,g,m){let b=o.children(m);if(!b.length){m!==c&&o.setEdge(c,m,{weight:0,minlen:f});return}let x=e.addBorderNode(o,"_bt"),w=e.addBorderNode(o,"_bb"),_=o.node(m);o.setParent(x,m),_.borderTop=x,o.setParent(w,m),_.borderBottom=w,b.forEach(k=>{n(o,c,f,d,p,g,k);let A=o.node(k),S=A.borderTop?A.borderTop:k,O=A.borderBottom?A.borderBottom:k,D=A.borderTop?d:2*d,M=S!==O?1:p-g[m]+1;o.setEdge(x,S,{weight:D,minlen:M,nestingEdge:!0}),o.setEdge(O,w,{weight:D,minlen:M,nestingEdge:!0})}),o.parent(m)||o.setEdge(c,x,{weight:0,minlen:p+g[m]})}function r(o){var c={};function f(d,p){var g=o.children(d);g&&g.length&&g.forEach(m=>f(m,p+1)),c[d]=p}return o.children().forEach(d=>f(d,1)),c}function s(o){return o.edges().reduce((c,f)=>c+o.edge(f).weight,0)}function l(o){var c=o.graph();o.removeNode(c.nestingRoot),delete c.nestingRoot,o.edges().forEach(f=>{var d=o.edge(f);d.nestingEdge&&o.removeEdge(f)})}return Qp}var Kp,a_;function CF(){if(a_)return Kp;a_=1;let e=Tt();Kp=t;function t(r){function s(l){let o=r.children(l),c=r.node(l);if(o.length&&o.forEach(s),Object.hasOwn(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(let f=c.minRank,d=c.maxRank+1;f<d;++f)n(r,"borderLeft","_bl",l,c,f),n(r,"borderRight","_br",l,c,f)}}r.children().forEach(s)}function n(r,s,l,o,c,f){let d={width:0,height:0,rank:f,borderType:s},p=c[s][f-1],g=e.addDummyNode(r,"border",d,l);c[s][f]=g,r.setParent(g,o),p&&r.setEdge(p,g,{weight:1})}return Kp}var Jp,s_;function NF(){if(s_)return Jp;s_=1,Jp={adjust:e,undo:t};function e(f){let d=f.graph().rankdir.toLowerCase();(d==="lr"||d==="rl")&&n(f)}function t(f){let d=f.graph().rankdir.toLowerCase();(d==="bt"||d==="rl")&&s(f),(d==="lr"||d==="rl")&&(o(f),n(f))}function n(f){f.nodes().forEach(d=>r(f.node(d))),f.edges().forEach(d=>r(f.edge(d)))}function r(f){let d=f.width;f.width=f.height,f.height=d}function s(f){f.nodes().forEach(d=>l(f.node(d))),f.edges().forEach(d=>{let p=f.edge(d);p.points.forEach(l),Object.hasOwn(p,"y")&&l(p)})}function l(f){f.y=-f.y}function o(f){f.nodes().forEach(d=>c(f.node(d))),f.edges().forEach(d=>{let p=f.edge(d);p.points.forEach(c),Object.hasOwn(p,"x")&&c(p)})}function c(f){let d=f.x;f.x=f.y,f.y=d}return Jp}var Wp,l_;function OF(){if(l_)return Wp;l_=1;let e=Tt();Wp=t;function t(n){let r={},s=n.nodes().filter(p=>!n.children(p).length),l=s.map(p=>n.node(p).rank),o=e.applyWithChunking(Math.max,l),c=e.range(o+1).map(()=>[]);function f(p){if(r[p])return;r[p]=!0;let g=n.node(p);c[g.rank].push(p),n.successors(p).forEach(f)}return s.sort((p,g)=>n.node(p).rank-n.node(g).rank).forEach(f),c}return Wp}var eg,o_;function MF(){if(o_)return eg;o_=1;let e=Tt().zipObject;eg=t;function t(r,s){let l=0;for(let o=1;o<s.length;++o)l+=n(r,s[o-1],s[o]);return l}function n(r,s,l){let o=e(l,l.map((m,b)=>b)),c=s.flatMap(m=>r.outEdges(m).map(b=>({pos:o[b.w],weight:r.edge(b).weight})).sort((b,x)=>b.pos-x.pos)),f=1;for(;f<l.length;)f<<=1;let d=2*f-1;f-=1;let p=new Array(d).fill(0),g=0;return c.forEach(m=>{let b=m.pos+f;p[b]+=m.weight;let x=0;for(;b>0;)b%2&&(x+=p[b+1]),b=b-1>>1,p[b]+=m.weight;g+=m.weight*x}),g}return eg}var tg,u_;function RF(){if(u_)return tg;u_=1,tg=e;function e(t,n=[]){return n.map(r=>{let s=t.inEdges(r);if(s.length){let l=s.reduce((o,c)=>{let f=t.edge(c),d=t.node(c.v);return{sum:o.sum+f.weight*d.order,weight:o.weight+f.weight}},{sum:0,weight:0});return{v:r,barycenter:l.sum/l.weight,weight:l.weight}}else return{v:r}})}return tg}var ng,c_;function DF(){if(c_)return ng;c_=1;let e=Tt();ng=t;function t(s,l){let o={};s.forEach((f,d)=>{let p=o[f.v]={indegree:0,in:[],out:[],vs:[f.v],i:d};f.barycenter!==void 0&&(p.barycenter=f.barycenter,p.weight=f.weight)}),l.edges().forEach(f=>{let d=o[f.v],p=o[f.w];d!==void 0&&p!==void 0&&(p.indegree++,d.out.push(o[f.w]))});let c=Object.values(o).filter(f=>!f.indegree);return n(c)}function n(s){let l=[];function o(f){return d=>{d.merged||(d.barycenter===void 0||f.barycenter===void 0||d.barycenter>=f.barycenter)&&r(f,d)}}function c(f){return d=>{d.in.push(f),--d.indegree===0&&s.push(d)}}for(;s.length;){let f=s.pop();l.push(f),f.in.reverse().forEach(o(f)),f.out.forEach(c(f))}return l.filter(f=>!f.merged).map(f=>e.pick(f,["vs","i","barycenter","weight"]))}function r(s,l){let o=0,c=0;s.weight&&(o+=s.barycenter*s.weight,c+=s.weight),l.weight&&(o+=l.barycenter*l.weight,c+=l.weight),s.vs=l.vs.concat(s.vs),s.barycenter=o/c,s.weight=c,s.i=Math.min(l.i,s.i),l.merged=!0}return ng}var rg,f_;function jF(){if(f_)return rg;f_=1;let e=Tt();rg=t;function t(s,l){let o=e.partition(s,x=>Object.hasOwn(x,"barycenter")),c=o.lhs,f=o.rhs.sort((x,w)=>w.i-x.i),d=[],p=0,g=0,m=0;c.sort(r(!!l)),m=n(d,f,m),c.forEach(x=>{m+=x.vs.length,d.push(x.vs),p+=x.barycenter*x.weight,g+=x.weight,m=n(d,f,m)});let b={vs:d.flat(!0)};return g&&(b.barycenter=p/g,b.weight=g),b}function n(s,l,o){let c;for(;l.length&&(c=l[l.length-1]).i<=o;)l.pop(),s.push(c.vs),o++;return o}function r(s){return(l,o)=>l.barycenter<o.barycenter?-1:l.barycenter>o.barycenter?1:s?o.i-l.i:l.i-o.i}return rg}var ig,d_;function zF(){if(d_)return ig;d_=1;let e=RF(),t=DF(),n=jF();ig=r;function r(o,c,f,d){let p=o.children(c),g=o.node(c),m=g?g.borderLeft:void 0,b=g?g.borderRight:void 0,x={};m&&(p=p.filter(A=>A!==m&&A!==b));let w=e(o,p);w.forEach(A=>{if(o.children(A.v).length){let S=r(o,A.v,f,d);x[A.v]=S,Object.hasOwn(S,"barycenter")&&l(A,S)}});let _=t(w,f);s(_,x);let k=n(_,d);if(m&&(k.vs=[m,k.vs,b].flat(!0),o.predecessors(m).length)){let A=o.node(o.predecessors(m)[0]),S=o.node(o.predecessors(b)[0]);Object.hasOwn(k,"barycenter")||(k.barycenter=0,k.weight=0),k.barycenter=(k.barycenter*k.weight+A.order+S.order)/(k.weight+2),k.weight+=2}return k}function s(o,c){o.forEach(f=>{f.vs=f.vs.flatMap(d=>c[d]?c[d].vs:d)})}function l(o,c){o.barycenter!==void 0?(o.barycenter=(o.barycenter*o.weight+c.barycenter*c.weight)/(o.weight+c.weight),o.weight+=c.weight):(o.barycenter=c.barycenter,o.weight=c.weight)}return ig}var ag,h_;function LF(){if(h_)return ag;h_=1;let e=Zn().Graph,t=Tt();ag=n;function n(s,l,o){let c=r(s),f=new e({compound:!0}).setGraph({root:c}).setDefaultNodeLabel(d=>s.node(d));return s.nodes().forEach(d=>{let p=s.node(d),g=s.parent(d);(p.rank===l||p.minRank<=l&&l<=p.maxRank)&&(f.setNode(d),f.setParent(d,g||c),s[o](d).forEach(m=>{let b=m.v===d?m.w:m.v,x=f.edge(b,d),w=x!==void 0?x.weight:0;f.setEdge(b,d,{weight:s.edge(m).weight+w})}),Object.hasOwn(p,"minRank")&&f.setNode(d,{borderLeft:p.borderLeft[l],borderRight:p.borderRight[l]}))}),f}function r(s){for(var l;s.hasNode(l=t.uniqueId("_root")););return l}return ag}var sg,p_;function IF(){if(p_)return sg;p_=1,sg=e;function e(t,n,r){let s={},l;r.forEach(o=>{let c=t.parent(o),f,d;for(;c;){if(f=t.parent(c),f?(d=s[f],s[f]=c):(d=l,l=c),d&&d!==c){n.setEdge(d,c);return}c=f}})}return sg}var lg,g_;function BF(){if(g_)return lg;g_=1;let e=OF(),t=MF(),n=zF(),r=LF(),s=IF(),l=Zn().Graph,o=Tt();lg=c;function c(g,m){if(m&&typeof m.customOrder=="function"){m.customOrder(g,c);return}let b=o.maxRank(g),x=f(g,o.range(1,b+1),"inEdges"),w=f(g,o.range(b-1,-1,-1),"outEdges"),_=e(g);if(p(g,_),m&&m.disableOptimalOrderHeuristic)return;let k=Number.POSITIVE_INFINITY,A;for(let S=0,O=0;O<4;++S,++O){d(S%2?x:w,S%4>=2),_=o.buildLayerMatrix(g);let D=t(g,_);D<k&&(O=0,A=Object.assign({},_),k=D)}p(g,A)}function f(g,m,b){return m.map(function(x){return r(g,x,b)})}function d(g,m){let b=new l;g.forEach(function(x){let w=x.graph().root,_=n(x,w,b,m);_.vs.forEach((k,A)=>x.node(k).order=A),s(x,b,_.vs)})}function p(g,m){Object.values(m).forEach(b=>b.forEach((x,w)=>g.node(x).order=w))}return lg}var og,m_;function FF(){if(m_)return og;m_=1;let e=Zn().Graph,t=Tt();og={positionX:b,findType1Conflicts:n,findType2Conflicts:r,addConflict:l,hasConflict:o,verticalAlignment:c,horizontalCompaction:f,alignCoordinates:g,findSmallestWidthAlignment:p,balance:m};function n(_,k){let A={};function S(O,D){let M=0,F=0,L=O.length,U=D[D.length-1];return D.forEach((j,H)=>{let B=s(_,j),q=B?_.node(B).order:L;(B||j===U)&&(D.slice(F,H+1).forEach(R=>{_.predecessors(R).forEach($=>{let I=_.node($),P=I.order;(P<M||q<P)&&!(I.dummy&&_.node(R).dummy)&&l(A,$,R)})}),F=H+1,M=q)}),D}return k.length&&k.reduce(S),A}function r(_,k){let A={};function S(D,M,F,L,U){let j;t.range(M,F).forEach(H=>{j=D[H],_.node(j).dummy&&_.predecessors(j).forEach(B=>{let q=_.node(B);q.dummy&&(q.order<L||q.order>U)&&l(A,B,j)})})}function O(D,M){let F=-1,L,U=0;return M.forEach((j,H)=>{if(_.node(j).dummy==="border"){let B=_.predecessors(j);B.length&&(L=_.node(B[0]).order,S(M,U,H,F,L),U=H,F=L)}S(M,U,M.length,L,D.length)}),M}return k.length&&k.reduce(O),A}function s(_,k){if(_.node(k).dummy)return _.predecessors(k).find(A=>_.node(A).dummy)}function l(_,k,A){if(k>A){let O=k;k=A,A=O}let S=_[k];S||(_[k]=S={}),S[A]=!0}function o(_,k,A){if(k>A){let S=k;k=A,A=S}return!!_[k]&&Object.hasOwn(_[k],A)}function c(_,k,A,S){let O={},D={},M={};return k.forEach(F=>{F.forEach((L,U)=>{O[L]=L,D[L]=L,M[L]=U})}),k.forEach(F=>{let L=-1;F.forEach(U=>{let j=S(U);if(j.length){j=j.sort((B,q)=>M[B]-M[q]);let H=(j.length-1)/2;for(let B=Math.floor(H),q=Math.ceil(H);B<=q;++B){let R=j[B];D[U]===U&&L<M[R]&&!o(A,U,R)&&(D[R]=U,D[U]=O[U]=O[R],L=M[R])}}})}),{root:O,align:D}}function f(_,k,A,S,O){let D={},M=d(_,k,A,O),F=O?"borderLeft":"borderRight";function L(H,B){let q=M.nodes(),R=q.pop(),$={};for(;R;)$[R]?H(R):($[R]=!0,q.push(R),q=q.concat(B(R))),R=q.pop()}function U(H){D[H]=M.inEdges(H).reduce((B,q)=>Math.max(B,D[q.v]+M.edge(q)),0)}function j(H){let B=M.outEdges(H).reduce((R,$)=>Math.min(R,D[$.w]-M.edge($)),Number.POSITIVE_INFINITY),q=_.node(H);B!==Number.POSITIVE_INFINITY&&q.borderType!==F&&(D[H]=Math.max(D[H],B))}return L(U,M.predecessors.bind(M)),L(j,M.successors.bind(M)),Object.keys(S).forEach(H=>D[H]=D[A[H]]),D}function d(_,k,A,S){let O=new e,D=_.graph(),M=x(D.nodesep,D.edgesep,S);return k.forEach(F=>{let L;F.forEach(U=>{let j=A[U];if(O.setNode(j),L){var H=A[L],B=O.edge(H,j);O.setEdge(H,j,Math.max(M(_,U,L),B||0))}L=U})}),O}function p(_,k){return Object.values(k).reduce((A,S)=>{let O=Number.NEGATIVE_INFINITY,D=Number.POSITIVE_INFINITY;Object.entries(S).forEach(([F,L])=>{let U=w(_,F)/2;O=Math.max(L+U,O),D=Math.min(L-U,D)});const M=O-D;return M<A[0]&&(A=[M,S]),A},[Number.POSITIVE_INFINITY,null])[1]}function g(_,k){let A=Object.values(k),S=t.applyWithChunking(Math.min,A),O=t.applyWithChunking(Math.max,A);["u","d"].forEach(D=>{["l","r"].forEach(M=>{let F=D+M,L=_[F];if(L===k)return;let U=Object.values(L),j=S-t.applyWithChunking(Math.min,U);M!=="l"&&(j=O-t.applyWithChunking(Math.max,U)),j&&(_[F]=t.mapValues(L,H=>H+j))})})}function m(_,k){return t.mapValues(_.ul,(A,S)=>{if(k)return _[k.toLowerCase()][S];{let O=Object.values(_).map(D=>D[S]).sort((D,M)=>D-M);return(O[1]+O[2])/2}})}function b(_){let k=t.buildLayerMatrix(_),A=Object.assign(n(_,k),r(_,k)),S={},O;["u","d"].forEach(M=>{O=M==="u"?k:Object.values(k).reverse(),["l","r"].forEach(F=>{F==="r"&&(O=O.map(H=>Object.values(H).reverse()));let L=(M==="u"?_.predecessors:_.successors).bind(_),U=c(_,O,A,L),j=f(_,O,U.root,U.align,F==="r");F==="r"&&(j=t.mapValues(j,H=>-H)),S[M+F]=j})});let D=p(_,S);return g(S,D),m(S,_.graph().align)}function x(_,k,A){return(S,O,D)=>{let M=S.node(O),F=S.node(D),L=0,U;if(L+=M.width/2,Object.hasOwn(M,"labelpos"))switch(M.labelpos.toLowerCase()){case"l":U=-M.width/2;break;case"r":U=M.width/2;break}if(U&&(L+=A?U:-U),U=0,L+=(M.dummy?k:_)/2,L+=(F.dummy?k:_)/2,L+=F.width/2,Object.hasOwn(F,"labelpos"))switch(F.labelpos.toLowerCase()){case"l":U=F.width/2;break;case"r":U=-F.width/2;break}return U&&(L+=A?U:-U),U=0,L}}function w(_,k){return _.node(k).width}return og}var ug,y_;function PF(){if(y_)return ug;y_=1;let e=Tt(),t=FF().positionX;ug=n;function n(s){s=e.asNonCompoundGraph(s),r(s),Object.entries(t(s)).forEach(([l,o])=>s.node(l).x=o)}function r(s){let l=e.buildLayerMatrix(s),o=s.graph().ranksep,c=0;l.forEach(f=>{const d=f.reduce((p,g)=>{const m=s.node(g).height;return p>m?p:m},0);f.forEach(p=>s.node(p).y=c+d/2),c+=d+o})}return ug}var cg,b_;function UF(){if(b_)return cg;b_=1;let e=_F(),t=SF(),n=EF(),r=Tt().normalizeRanks,s=AF(),l=Tt().removeEmptyRanks,o=TF(),c=CF(),f=NF(),d=BF(),p=PF(),g=Tt(),m=Zn().Graph;cg=b;function b(T,V){let K=V&&V.debugTiming?g.time:g.notime;K("layout",()=>{let J=K(" buildLayoutGraph",()=>L(T));K(" runLayout",()=>x(J,K,V)),K(" updateInputGraph",()=>w(T,J))})}function x(T,V,K){V(" makeSpaceForEdgeLabels",()=>U(T)),V(" removeSelfEdges",()=>Y(T)),V(" acyclic",()=>e.run(T)),V(" nestingGraph.run",()=>o.run(T)),V(" rank",()=>n(g.asNonCompoundGraph(T))),V(" injectEdgeLabelProxies",()=>j(T)),V(" removeEmptyRanks",()=>l(T)),V(" nestingGraph.cleanup",()=>o.cleanup(T)),V(" normalizeRanks",()=>r(T)),V(" assignRankMinMax",()=>H(T)),V(" removeEdgeLabelProxies",()=>B(T)),V(" normalize.run",()=>t.run(T)),V(" parentDummyChains",()=>s(T)),V(" addBorderSegments",()=>c(T)),V(" order",()=>d(T,K)),V(" insertSelfEdges",()=>X(T)),V(" adjustCoordinateSystem",()=>f.adjust(T)),V(" position",()=>p(T)),V(" positionSelfEdges",()=>E(T)),V(" removeBorderNodes",()=>P(T)),V(" normalize.undo",()=>t.undo(T)),V(" fixupEdgeLabelCoords",()=>$(T)),V(" undoCoordinateSystem",()=>f.undo(T)),V(" translateGraph",()=>q(T)),V(" assignNodeIntersects",()=>R(T)),V(" reversePoints",()=>I(T)),V(" acyclic.undo",()=>e.undo(T))}function w(T,V){T.nodes().forEach(K=>{let J=T.node(K),le=V.node(K);J&&(J.x=le.x,J.y=le.y,J.rank=le.rank,V.children(K).length&&(J.width=le.width,J.height=le.height))}),T.edges().forEach(K=>{let J=T.edge(K),le=V.edge(K);J.points=le.points,Object.hasOwn(le,"x")&&(J.x=le.x,J.y=le.y)}),T.graph().width=V.graph().width,T.graph().height=V.graph().height}let _=["nodesep","edgesep","ranksep","marginx","marginy"],k={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},A=["acyclicer","ranker","rankdir","align"],S=["width","height"],O={width:0,height:0},D=["minlen","weight","width","height","labeloffset"],M={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},F=["labelpos"];function L(T){let V=new m({multigraph:!0,compound:!0}),K=te(T.graph());return V.setGraph(Object.assign({},k,G(K,_),g.pick(K,A))),T.nodes().forEach(J=>{let le=te(T.node(J));const fe=G(le,S);Object.keys(O).forEach(ye=>{fe[ye]===void 0&&(fe[ye]=O[ye])}),V.setNode(J,fe),V.setParent(J,T.parent(J))}),T.edges().forEach(J=>{let le=te(T.edge(J));V.setEdge(J,Object.assign({},M,G(le,D),g.pick(le,F)))}),V}function U(T){let V=T.graph();V.ranksep/=2,T.edges().forEach(K=>{let J=T.edge(K);J.minlen*=2,J.labelpos.toLowerCase()!=="c"&&(V.rankdir==="TB"||V.rankdir==="BT"?J.width+=J.labeloffset:J.height+=J.labeloffset)})}function j(T){T.edges().forEach(V=>{let K=T.edge(V);if(K.width&&K.height){let J=T.node(V.v),fe={rank:(T.node(V.w).rank-J.rank)/2+J.rank,e:V};g.addDummyNode(T,"edge-proxy",fe,"_ep")}})}function H(T){let V=0;T.nodes().forEach(K=>{let J=T.node(K);J.borderTop&&(J.minRank=T.node(J.borderTop).rank,J.maxRank=T.node(J.borderBottom).rank,V=Math.max(V,J.maxRank))}),T.graph().maxRank=V}function B(T){T.nodes().forEach(V=>{let K=T.node(V);K.dummy==="edge-proxy"&&(T.edge(K.e).labelRank=K.rank,T.removeNode(V))})}function q(T){let V=Number.POSITIVE_INFINITY,K=0,J=Number.POSITIVE_INFINITY,le=0,fe=T.graph(),ye=fe.marginx||0,Ae=fe.marginy||0;function Se(be){let je=be.x,ze=be.y,lt=be.width,ft=be.height;V=Math.min(V,je-lt/2),K=Math.max(K,je+lt/2),J=Math.min(J,ze-ft/2),le=Math.max(le,ze+ft/2)}T.nodes().forEach(be=>Se(T.node(be))),T.edges().forEach(be=>{let je=T.edge(be);Object.hasOwn(je,"x")&&Se(je)}),V-=ye,J-=Ae,T.nodes().forEach(be=>{let je=T.node(be);je.x-=V,je.y-=J}),T.edges().forEach(be=>{let je=T.edge(be);je.points.forEach(ze=>{ze.x-=V,ze.y-=J}),Object.hasOwn(je,"x")&&(je.x-=V),Object.hasOwn(je,"y")&&(je.y-=J)}),fe.width=K-V+ye,fe.height=le-J+Ae}function R(T){T.edges().forEach(V=>{let K=T.edge(V),J=T.node(V.v),le=T.node(V.w),fe,ye;K.points?(fe=K.points[0],ye=K.points[K.points.length-1]):(K.points=[],fe=le,ye=J),K.points.unshift(g.intersectRect(J,fe)),K.points.push(g.intersectRect(le,ye))})}function $(T){T.edges().forEach(V=>{let K=T.edge(V);if(Object.hasOwn(K,"x"))switch((K.labelpos==="l"||K.labelpos==="r")&&(K.width-=K.labeloffset),K.labelpos){case"l":K.x-=K.width/2+K.labeloffset;break;case"r":K.x+=K.width/2+K.labeloffset;break}})}function I(T){T.edges().forEach(V=>{let K=T.edge(V);K.reversed&&K.points.reverse()})}function P(T){T.nodes().forEach(V=>{if(T.children(V).length){let K=T.node(V),J=T.node(K.borderTop),le=T.node(K.borderBottom),fe=T.node(K.borderLeft[K.borderLeft.length-1]),ye=T.node(K.borderRight[K.borderRight.length-1]);K.width=Math.abs(ye.x-fe.x),K.height=Math.abs(le.y-J.y),K.x=fe.x+K.width/2,K.y=J.y+K.height/2}}),T.nodes().forEach(V=>{T.node(V).dummy==="border"&&T.removeNode(V)})}function Y(T){T.edges().forEach(V=>{if(V.v===V.w){var K=T.node(V.v);K.selfEdges||(K.selfEdges=[]),K.selfEdges.push({e:V,label:T.edge(V)}),T.removeEdge(V)}})}function X(T){var V=g.buildLayerMatrix(T);V.forEach(K=>{var J=0;K.forEach((le,fe)=>{var ye=T.node(le);ye.order=fe+J,(ye.selfEdges||[]).forEach(Ae=>{g.addDummyNode(T,"selfedge",{width:Ae.label.width,height:Ae.label.height,rank:ye.rank,order:fe+ ++J,e:Ae.e,label:Ae.label},"_se")}),delete ye.selfEdges})})}function E(T){T.nodes().forEach(V=>{var K=T.node(V);if(K.dummy==="selfedge"){var J=T.node(K.e.v),le=J.x+J.width/2,fe=J.y,ye=K.x-le,Ae=J.height/2;T.setEdge(K.e,K.label),T.removeNode(V),K.label.points=[{x:le+2*ye/3,y:fe-Ae},{x:le+5*ye/6,y:fe-Ae},{x:le+ye,y:fe},{x:le+5*ye/6,y:fe+Ae},{x:le+2*ye/3,y:fe+Ae}],K.label.x=K.x,K.label.y=K.y}})}function G(T,V){return g.mapValues(g.pick(T,V),Number)}function te(T){var V={};return T&&Object.entries(T).forEach(([K,J])=>{typeof K=="string"&&(K=K.toLowerCase()),V[K]=J}),V}return cg}var fg,v_;function HF(){if(v_)return fg;v_=1;let e=Tt(),t=Zn().Graph;fg={debugOrdering:n};function n(r){let s=e.buildLayerMatrix(r),l=new t({compound:!0,multigraph:!0}).setGraph({});return r.nodes().forEach(o=>{l.setNode(o,{label:o}),l.setParent(o,"layer"+r.node(o).rank)}),r.edges().forEach(o=>l.setEdge(o.v,o.w,{},o.name)),s.forEach((o,c)=>{let f="layer"+c;l.setNode(f,{rank:"same"}),o.reduce((d,p)=>(l.setEdge(d,p,{style:"invis"}),p))}),l}return fg}var dg,x_;function $F(){return x_||(x_=1,dg="1.1.4"),dg}var hg,w_;function VF(){return w_||(w_=1,hg={graphlib:Zn(),layout:UF(),debug:HF(),util:{time:Tt().time,notime:Tt().notime},version:$F()}),hg}var qF=VF();const __=ki(qF);function GF(e){const t=new Map,n=[],r=l=>{const o=l.id.split(":"),c=o.slice(0,-1).join(":");if(o.length!==1){if(!t.has(c)){const f={id:c,type:"group",data:{label:c.split(":").pop(),name:c.split(":").pop()},position:{x:0,y:0},style:{},parentId:void 0},d=r(f);d&&(f.parentId=d.id),t.set(c,f)}return t.get(c)}};return e.forEach(l=>{const o={...l,id:l.id.toString(),position:{x:0,y:0},data:{label:l.id.split(":").pop(),name:l.id.split(":").pop()}},c=r(o);c&&(o.parentId=c.id.toString()),n.push(o)}),[...Array.from(t.values()),...n]}const ZF={group:({data:e})=>C.jsx("div",{className:"absolute bottom-full left-0",children:C.jsx("span",{children:e.name})})},YF=(e,t)=>{const n=e.map(r=>{const s=t.find(f=>f.id===r.source.toString()),l=t.find(f=>f.id===r.target.toString()),o=s==null?void 0:s.id,c=l==null?void 0:l.id;return{id:`${o}=${c}`,source:o,target:c,animated:r.conditional,label:r.data,style:{stroke:r.conditional?"#2563eb":"#64748b"}}});if(!n.find(r=>r.target==="__end__")){const r=[...t].reverse().find(s=>s.id.endsWith(":__end__"));r&&n.push({id:`${r.id}=__end__`,source:r.id,target:"__end__",type:"smoothstep"})}return n},XF=()=>{const{fitView:e}=sf(),{graphVisualize:t,currentNodeName:n}=oa(),r=t||{nodes:[],edges:[]},s=GF(r.nodes.map(b=>({...b,type:"default"}))),l=YF(r.edges,s),[o,c,f]=z7(s),[d,p,g]=L7(l),m=W.useCallback(b=>{const x=S_(o,d,{direction:b});c([...x.nodes]),p([...x.edges]),e()},[o,d]);return W.useEffect(()=>{if(r.nodes.length>0){const b=S_(s,l,{direction:"TB"});c([...b.nodes]),p([...b.edges]),e()}},[r]),W.useEffect(()=>{const b=o.findIndex(x=>x.id.endsWith(n));if(b!==-1){const x=[...o].map(w=>({...w,selected:!1}));x[b]={...x[b],selected:!0},c(x),e()}},[n]),C.jsx("div",{className:"w-1/3 h-full relative overflow-hidden border-l",children:C.jsxs(j7,{nodes:o,edges:d,onNodesChange:f,onEdgesChange:g,fitView:!0,className:"w-full h-full",nodeTypes:ZF,children:[C.jsx(U7,{}),C.jsx(Y7,{}),C.jsxs(mo,{position:"top-right",className:"flex gap-2",children:[C.jsx("button",{onClick:()=>m("TB"),className:"px-3 py-1.5 bg-white border border-gray-200 rounded-lg text-sm text-gray-700 hover:bg-gray-50 transition-colors",children:"垂直布局"}),C.jsx("button",{onClick:()=>m("LR"),className:"px-3 py-1.5 bg-white border border-gray-200 rounded-lg text-sm text-gray-700 hover:bg-gray-50 transition-colors",children:"水平布局"})]})]})})},S_=(e,t,n)=>{const r=new __.graphlib.Graph({compound:!0,multigraph:!0}).setDefaultEdgeLabel(()=>({}));r.setGraph({rankdir:n.direction,nodesep:40,ranksep:40,edgesep:20}),e.forEach(c=>{c.type!=="group"&&r.setNode(c.id,{...c,width:128,height:20})}),t.forEach(c=>r.setEdge(c.source,c.target)),__.layout(r);const s=e.map(c=>{const f=r.node(c.id);if(!f)return{...c};let d=0,p=0;return d=f.x+((f==null?void 0:f.width)??0),p=f.y+((f==null?void 0:f.height)??0),{...c,position:{x:d,y:p},_p:f,width:f.width,height:f.height}}),l=new Map,o=15;return[...s].reverse().forEach(c=>{if(c.type==="group"){const f=l.get(c.id)||[],d=Math.min(...f.map(b=>b.position.x)),p=Math.min(...f.map(b=>b.position.y)),g=Math.max(...f.map(b=>b.position.x+(b.width??0))),m=Math.max(...f.map(b=>b.position.y+(b.height??0)));c.position.x=d-o,c.position.y=p-o,c.width=g-d+o*2,c.height=m-p+o*2,f.forEach(b=>{b.position.x=b.position.x-c.position.x,b.position.y=b.position.y-c.position.y})}c.parentId&&l.set(c.parentId,[...l.get(c.parentId)??[],c])}),{nodes:s,edges:t}};function QF(){return C.jsx(e2,{children:C.jsx(XF,{})})}const KF=()=>C.jsx(QF,{});/**
|
|
243
|
+
`)),p=d.reduce((g,m)=>g.concat(...m),[]);return[d,p]}return[[],[]]},[e]);return W.useEffect(()=>{const f=(t==null?void 0:t.target)??dw,d=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const p=b=>{var _,k;if(s.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!s.current||s.current&&!d)&&sE(b))return!1;const w=pw(b.code,c);if(l.current.add(b[w]),hw(o,l.current,!1)){const A=((k=(_=b.composedPath)==null?void 0:_.call(b))==null?void 0:k[0])||b.target,S=(A==null?void 0:A.nodeName)==="BUTTON"||(A==null?void 0:A.nodeName)==="A";t.preventDefault!==!1&&(s.current||!S)&&b.preventDefault(),r(!0)}},g=b=>{const x=pw(b.code,c);hw(o,l.current,!0)?(r(!1),l.current.clear()):l.current.delete(b[x]),b.key==="Meta"&&l.current.clear(),s.current=!1},m=()=>{l.current.clear(),r(!1)};return f==null||f.addEventListener("keydown",p),f==null||f.addEventListener("keyup",g),window.addEventListener("blur",m),window.addEventListener("contextmenu",m),()=>{f==null||f.removeEventListener("keydown",p),f==null||f.removeEventListener("keyup",g),window.removeEventListener("blur",m),window.removeEventListener("contextmenu",m)}}},[e,r]),n}function hw(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function pw(e,t){return t.includes(e)?"code":"key"}const gB=()=>{const e=ht();return W.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,s,l],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??l},{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>{const{width:s,height:l,maxZoom:o,panZoom:c}=e.getState(),f=typeof(r==null?void 0:r.zoom)<"u"?r.zoom:o,d=s/2-t*f,p=l/2-n*f;return c?(await c.setViewport({x:d,y:p,zoom:f},{duration:r==null?void 0:r.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:r,height:s,minZoom:l,maxZoom:o,panZoom:c}=e.getState(),f=Lm(t,r,s,l,o,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(f,{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:s,snapToGrid:l,domNode:o}=e.getState();if(!o)return t;const{x:c,y:f}=o.getBoundingClientRect(),d={x:t.x-c,y:t.y-f},p=n.snapGrid??s,g=n.snapToGrid??l;return go(d,r,g,p)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:l}=r.getBoundingClientRect(),o=Rc(t,n);return{x:o.x+s,y:o.y+l}}}),[])};function TE(e,t){const n=[],r=new Map,s=[];for(const l of e)if(l.type==="add"){s.push(l);continue}else if(l.type==="remove"||l.type==="replace")r.set(l.id,[l]);else{const o=r.get(l.id);o?o.push(l):r.set(l.id,[l])}for(const l of t){const o=r.get(l.id);if(!o){n.push(l);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const c={...l};for(const f of o)mB(f,c);n.push(c)}return s.length&&s.forEach(l=>{l.index!==void 0?n.splice(l.index,0,{...l.item}):n.push({...l.item})}),n}function mB(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??(t.measured={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function NE(e,t){return TE(e,t)}function CE(e,t){return TE(e,t)}function Yi(e,t){return{id:e,type:"select",selected:t}}function ns(e,t=new Set,n=!1){const r=[];for(const[s,l]of e){const o=t.has(s);!(l.selected===void 0&&!o)&&l.selected!==o&&(n&&(l.selected=o),r.push(Yi(l.id,o)))}return r}function gw({items:e=[],lookup:t}){var s;const n=[],r=new Map(e.map(l=>[l.id,l]));for(const[l,o]of e.entries()){const c=t.get(o.id),f=((s=c==null?void 0:c.internals)==null?void 0:s.userNode)??c;f!==void 0&&f!==o&&n.push({id:o.id,item:o,type:"replace"}),f===void 0&&n.push({item:o,type:"add",index:l})}for(const[l]of t)r.get(l)===void 0&&n.push({id:l,type:"remove"});return n}function mw(e){return{id:e.id,type:"remove"}}const yw=e=>$6(e),yB=e=>Kk(e);function OE(e){return W.forwardRef(e)}const bB=typeof window<"u"?W.useLayoutEffect:W.useEffect;function bw(e){const[t,n]=W.useState(BigInt(0)),[r]=W.useState(()=>vB(()=>n(s=>s+BigInt(1))));return bB(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function vB(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const ME=W.createContext(null);function xB({children:e}){const t=ht(),n=W.useCallback(c=>{const{nodes:f=[],setNodes:d,hasDefaultNodes:p,onNodesChange:g,nodeLookup:m,fitViewQueued:b}=t.getState();let x=f;for(const _ of c)x=typeof _=="function"?_(x):_;const w=gw({items:x,lookup:m});p&&d(x),w.length>0?g==null||g(w):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:_,nodes:k,setNodes:A}=t.getState();_&&A(k)})},[]),r=bw(n),s=W.useCallback(c=>{const{edges:f=[],setEdges:d,hasDefaultEdges:p,onEdgesChange:g,edgeLookup:m}=t.getState();let b=f;for(const x of c)b=typeof x=="function"?x(b):x;p?d(b):g&&g(gw({items:b,lookup:m}))},[]),l=bw(s),o=W.useMemo(()=>({nodeQueue:r,edgeQueue:l}),[]);return N.jsx(ME.Provider,{value:o,children:e})}function wB(){const e=W.useContext(ME);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const _B=e=>!!e.panZoom;function sf(){const e=gB(),t=ht(),n=wB(),r=Ge(_B),s=W.useMemo(()=>{const l=g=>t.getState().nodeLookup.get(g),o=g=>{n.nodeQueue.push(g)},c=g=>{n.edgeQueue.push(g)},f=g=>{var k,A;const{nodeLookup:m,nodeOrigin:b}=t.getState(),x=yw(g)?g:m.get(g.id),w=x.parentId?iE(x.position,x.measured,x.parentId,m,b):x.position,_={...x,position:w,width:((k=x.measured)==null?void 0:k.width)??x.width,height:((A=x.measured)==null?void 0:A.height)??x.height};return ys(_)},d=(g,m,b={replace:!1})=>{o(x=>x.map(w=>{if(w.id===g){const _=typeof m=="function"?m(w):m;return b.replace&&yw(_)?_:{...w,..._}}return w}))},p=(g,m,b={replace:!1})=>{c(x=>x.map(w=>{if(w.id===g){const _=typeof m=="function"?m(w):m;return b.replace&&yB(_)?_:{...w,..._}}return w}))};return{getNodes:()=>t.getState().nodes.map(g=>({...g})),getNode:g=>{var m;return(m=l(g))==null?void 0:m.internals.userNode},getInternalNode:l,getEdges:()=>{const{edges:g=[]}=t.getState();return g.map(m=>({...m}))},getEdge:g=>t.getState().edgeLookup.get(g),setNodes:o,setEdges:c,addNodes:g=>{const m=Array.isArray(g)?g:[g];n.nodeQueue.push(b=>[...b,...m])},addEdges:g=>{const m=Array.isArray(g)?g:[g];n.edgeQueue.push(b=>[...b,...m])},toObject:()=>{const{nodes:g=[],edges:m=[],transform:b}=t.getState(),[x,w,_]=b;return{nodes:g.map(k=>({...k})),edges:m.map(k=>({...k})),viewport:{x,y:w,zoom:_}}},deleteElements:async({nodes:g=[],edges:m=[]})=>{const{nodes:b,edges:x,onNodesDelete:w,onEdgesDelete:_,triggerNodeChanges:k,triggerEdgeChanges:A,onDelete:S,onBeforeDelete:O}=t.getState(),{nodes:D,edges:M}=await Y6({nodesToRemove:g,edgesToRemove:m,nodes:b,edges:x,onBeforeDelete:O}),F=M.length>0,L=D.length>0;if(F){const U=M.map(mw);_==null||_(M),A(U)}if(L){const U=D.map(mw);w==null||w(D),k(U)}return(L||F)&&(S==null||S({nodes:D,edges:M})),{deletedNodes:D,deletedEdges:M}},getIntersectingNodes:(g,m=!0,b)=>{const x=V1(g),w=x?g:f(g),_=b!==void 0;return w?(b||t.getState().nodes).filter(k=>{const A=t.getState().nodeLookup.get(k.id);if(A&&!x&&(k.id===g.id||!A.internals.positionAbsolute))return!1;const S=ys(_?k:A),O=ro(S,w);return m&&O>0||O>=w.width*w.height}):[]},isNodeIntersecting:(g,m,b=!0)=>{const w=V1(g)?g:f(g);if(!w)return!1;const _=ro(w,m);return b&&_>0||_>=w.width*w.height},updateNode:d,updateNodeData:(g,m,b={replace:!1})=>{d(g,x=>{const w=typeof m=="function"?m(x):m;return b.replace?{...x,data:w}:{...x,data:{...x.data,...w}}},b)},updateEdge:p,updateEdgeData:(g,m,b={replace:!1})=>{p(g,x=>{const w=typeof m=="function"?m(x):m;return b.replace?{...x,data:w}:{...x,data:{...x.data,...w}}},b)},getNodesBounds:g=>{const{nodeLookup:m,nodeOrigin:b}=t.getState();return V6(g,{nodeLookup:m,nodeOrigin:b})},getHandleConnections:({type:g,id:m,nodeId:b})=>{var x;return Array.from(((x=t.getState().connectionLookup.get(`${b}-${g}${m?`-${m}`:""}`))==null?void 0:x.values())??[])},getNodeConnections:({type:g,handleId:m,nodeId:b})=>{var x;return Array.from(((x=t.getState().connectionLookup.get(`${b}${g?m?`-${g}-${m}`:`-${g}`:""}`))==null?void 0:x.values())??[])},fitView:async g=>{const m=t.getState().fitViewResolver??J6();return t.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:m}),n.nodeQueue.push(b=>[...b]),m.promise}}},[]);return W.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const vw=e=>e.selected,SB=typeof window<"u"?window:void 0;function kB({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ht(),{deleteElements:r}=sf(),s=ao(e,{actInsideInputWithModifier:!1}),l=ao(t,{target:SB});W.useEffect(()=>{if(s){const{edges:o,nodes:c}=n.getState();r({nodes:c.filter(vw),edges:o.filter(vw)}),n.setState({nodesSelectionActive:!1})}},[s]),W.useEffect(()=>{n.setState({multiSelectionActive:l})},[l])}function EB(e){const t=ht();W.useEffect(()=>{const n=()=>{var s,l;if(!e.current)return!1;const r=Im(e.current);(r.height===0||r.width===0)&&((l=(s=t.getState()).onError)==null||l.call(s,"004",or.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const lf={position:"absolute",width:"100%",height:"100%",top:0,left:0},AB=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function TB({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:l=na.Free,zoomOnDoubleClick:o=!0,panOnDrag:c=!0,defaultViewport:f,translateExtent:d,minZoom:p,maxZoom:g,zoomActivationKeyCode:m,preventScrolling:b=!0,children:x,noWheelClassName:w,noPanClassName:_,onViewportChange:k,isControlledViewport:A,paneClickDistance:S}){const O=ht(),D=W.useRef(null),{userSelectionActive:M,lib:F}=Ge(AB,yt),L=ao(m),U=W.useRef();EB(D);const j=W.useCallback(H=>{k==null||k({x:H[0],y:H[1],zoom:H[2]}),A||O.setState({transform:H})},[k,A]);return W.useEffect(()=>{if(D.current){U.current=M8({domNode:D.current,minZoom:p,maxZoom:g,translateExtent:d,viewport:f,paneClickDistance:S,onDraggingChange:R=>O.setState({paneDragging:R}),onPanZoomStart:(R,$)=>{const{onViewportChangeStart:I,onMoveStart:P}=O.getState();P==null||P(R,$),I==null||I($)},onPanZoom:(R,$)=>{const{onViewportChange:I,onMove:P}=O.getState();P==null||P(R,$),I==null||I($)},onPanZoomEnd:(R,$)=>{const{onViewportChangeEnd:I,onMoveEnd:P}=O.getState();P==null||P(R,$),I==null||I($)}});const{x:H,y:B,zoom:q}=U.current.getViewport();return O.setState({panZoom:U.current,transform:[H,B,q],domNode:D.current.closest(".react-flow")}),()=>{var R;(R=U.current)==null||R.destroy()}}},[]),W.useEffect(()=>{var H;(H=U.current)==null||H.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:l,zoomOnDoubleClick:o,panOnDrag:c,zoomActivationKeyPressed:L,preventScrolling:b,noPanClassName:_,userSelectionActive:M,noWheelClassName:w,lib:F,onTransformChange:j})},[e,t,n,r,s,l,o,c,L,b,_,M,w,F,j]),N.jsx("div",{className:"react-flow__renderer",ref:D,style:lf,children:x})}const NB=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function CB(){const{userSelectionActive:e,userSelectionRect:t}=Ge(NB,yt);return e&&t?N.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const vp=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},OB=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function MB({isSelecting:e,selectionKeyPressed:t,selectionMode:n=no.Full,panOnDrag:r,selectionOnDrag:s,onSelectionStart:l,onSelectionEnd:o,onPaneClick:c,onPaneContextMenu:f,onPaneScroll:d,onPaneMouseEnter:p,onPaneMouseMove:g,onPaneMouseLeave:m,children:b}){const x=ht(),{userSelectionActive:w,elementsSelectable:_,dragging:k,connectionInProgress:A}=Ge(OB,yt),S=_&&(e||w),O=W.useRef(null),D=W.useRef(),M=W.useRef(new Set),F=W.useRef(new Set),L=W.useRef(!1),U=W.useRef(!1),j=P=>{if(L.current||A){L.current=!1;return}c==null||c(P),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},H=P=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){P.preventDefault();return}f==null||f(P)},B=d?P=>d(P):void 0,q=P=>{var te,T;const{resetSelectedElements:Y,domNode:X}=x.getState();if(D.current=X==null?void 0:X.getBoundingClientRect(),!_||!e||P.button!==0||P.target!==O.current||!D.current)return;(T=(te=P.target)==null?void 0:te.setPointerCapture)==null||T.call(te,P.pointerId),U.current=!0,L.current=!1;const{x:E,y:G}=Dr(P.nativeEvent,D.current);Y(),x.setState({userSelectionRect:{width:0,height:0,startX:E,startY:G,x:E,y:G}}),l==null||l(P)},R=P=>{const{userSelectionRect:Y,transform:X,nodeLookup:E,edgeLookup:G,connectionLookup:te,triggerNodeChanges:T,triggerEdgeChanges:V,defaultEdgeOptions:K}=x.getState();if(!D.current||!Y)return;L.current=!0;const{x:J,y:le}=Dr(P.nativeEvent,D.current),{startX:fe,startY:ye}=Y,Ae={startX:fe,startY:ye,x:J<fe?J:fe,y:le<ye?le:ye,width:Math.abs(J-fe),height:Math.abs(le-ye)},Se=M.current,be=F.current;M.current=new Set(Jk(E,Ae,X,n===no.Partial,!0).map(ze=>ze.id)),F.current=new Set;const je=(K==null?void 0:K.selectable)??!0;for(const ze of M.current){const lt=te.get(ze);if(lt)for(const{edgeId:ft}of lt.values()){const xt=G.get(ft);xt&&(xt.selectable??je)&&F.current.add(ft)}}if(!q1(Se,M.current)){const ze=ns(E,M.current,!0);T(ze)}if(!q1(be,F.current)){const ze=ns(G,F.current);V(ze)}x.setState({userSelectionRect:Ae,userSelectionActive:!0,nodesSelectionActive:!1})},$=P=>{var X,E;if(P.button!==0||!U.current)return;(E=(X=P.target)==null?void 0:X.releasePointerCapture)==null||E.call(X,P.pointerId);const{userSelectionRect:Y}=x.getState();!w&&Y&&P.target===O.current&&(j==null||j(P)),x.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:M.current.size>0}),o==null||o(P),(t||s)&&(L.current=!1),U.current=!1},I=r===!0||Array.isArray(r)&&r.includes(0);return N.jsxs("div",{className:Nt(["react-flow__pane",{draggable:I,dragging:k,selection:e}]),onClick:S?void 0:vp(j,O),onContextMenu:vp(H,O),onWheel:vp(B,O),onPointerEnter:S?void 0:p,onPointerDown:S?q:g,onPointerMove:S?R:g,onPointerUp:S?$:void 0,onPointerLeave:m,ref:O,style:lf,children:[b,N.jsx(CB,{})]})}function tm({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:l,multiSelectionActive:o,nodeLookup:c,onError:f}=t.getState(),d=c.get(e);if(!d){f==null||f("012",or.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&o)&&(l({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var p;return(p=r==null?void 0:r.current)==null?void 0:p.blur()})):s([e])}function RE({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:l,nodeClickDistance:o}){const c=ht(),[f,d]=W.useState(!1),p=W.useRef();return W.useEffect(()=>{p.current=y8({getStoreItems:()=>c.getState(),onNodeMouseDown:g=>{tm({id:g,store:c,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),W.useEffect(()=>{var g,m;if(t)(g=p.current)==null||g.destroy();else if(e.current)return(m=p.current)==null||m.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:l,nodeId:s,nodeClickDistance:o}),()=>{var b;(b=p.current)==null||b.destroy()}},[n,r,t,l,e,s]),f}const RB=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function DE(){const e=ht();return W.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:l,nodesDraggable:o,onError:c,updateNodePositions:f,nodeLookup:d,nodeOrigin:p}=e.getState(),g=new Map,m=RB(o),b=s?l[0]:5,x=s?l[1]:5,w=n.direction.x*b*n.factor,_=n.direction.y*x*n.factor;for(const[,k]of d){if(!m(k))continue;let A={x:k.internals.positionAbsolute.x+w,y:k.internals.positionAbsolute.y+_};s&&(A=nf(A,l));const{position:S,positionAbsolute:O}=Wk({nodeId:k.id,nextPosition:A,nodeLookup:d,nodeExtent:r,nodeOrigin:p,onError:c});k.position=S,k.internals.positionAbsolute=O,g.set(k.id,k)}f(g)},[])}const Hm=W.createContext(null),DB=Hm.Provider;Hm.Consumer;const jE=()=>W.useContext(Hm),jB=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),zB=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:l,connection:o}=r,{fromHandle:c,toHandle:f,isValid:d}=o,p=(f==null?void 0:f.nodeId)===e&&(f==null?void 0:f.id)===t&&(f==null?void 0:f.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:p,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:l===gs.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!s,valid:p&&d}};function LB({type:e="source",position:t=Ce.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:l=!0,id:o,onConnect:c,children:f,className:d,onMouseDown:p,onTouchStart:g,...m},b){var $,I;const x=o||null,w=e==="target",_=ht(),k=jE(),{connectOnClick:A,noPanClassName:S,rfId:O}=Ge(jB,yt),{connectingFrom:D,connectingTo:M,clickConnecting:F,isPossibleEndHandle:L,connectionInProcess:U,clickConnectionInProcess:j,valid:H}=Ge(zB(k,x,e),yt);k||(I=($=_.getState()).onError)==null||I.call($,"010",or.error010());const B=P=>{const{defaultEdgeOptions:Y,onConnect:X,hasDefaultEdges:E}=_.getState(),G={...Y,...P};if(E){const{edges:te,setEdges:T}=_.getState();T(i8(G,te))}X==null||X(G),c==null||c(G)},q=P=>{if(!k)return;const Y=lE(P.nativeEvent);if(s&&(Y&&P.button===0||!Y)){const X=_.getState();em.onPointerDown(P.nativeEvent,{autoPanOnConnect:X.autoPanOnConnect,connectionMode:X.connectionMode,connectionRadius:X.connectionRadius,domNode:X.domNode,nodeLookup:X.nodeLookup,lib:X.lib,isTarget:w,handleId:x,nodeId:k,flowId:X.rfId,panBy:X.panBy,cancelConnection:X.cancelConnection,onConnectStart:X.onConnectStart,onConnectEnd:X.onConnectEnd,updateConnection:X.updateConnection,onConnect:B,isValidConnection:n||X.isValidConnection,getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,autoPanSpeed:X.autoPanSpeed})}Y?p==null||p(P):g==null||g(P)},R=P=>{const{onClickConnectStart:Y,onClickConnectEnd:X,connectionClickStartHandle:E,connectionMode:G,isValidConnection:te,lib:T,rfId:V,nodeLookup:K,connection:J}=_.getState();if(!k||!E&&!s)return;if(!E){Y==null||Y(P.nativeEvent,{nodeId:k,handleId:x,handleType:e}),_.setState({connectionClickStartHandle:{nodeId:k,type:e,id:x}});return}const le=aE(P.target),fe=n||te,{connection:ye,isValid:Ae}=em.isValid(P.nativeEvent,{handle:{nodeId:k,id:x,type:e},connectionMode:G,fromNodeId:E.nodeId,fromHandleId:E.id||null,fromType:E.type,isValidConnection:fe,flowId:V,doc:le,lib:T,nodeLookup:K});Ae&&ye&&B(ye);const Se=structuredClone(J);delete Se.inProgress,Se.toPosition=Se.toHandle?Se.toHandle.position:null,X==null||X(P,Se),_.setState({connectionClickStartHandle:null})};return N.jsx("div",{"data-handleid":x,"data-nodeid":k,"data-handlepos":t,"data-id":`${O}-${k}-${x}-${e}`,className:Nt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",S,d,{source:!w,target:w,connectable:r,connectablestart:s,connectableend:l,clickconnecting:F,connectingfrom:D,connectingto:M,valid:H,connectionindicator:r&&(!U||L)&&(U||j?l:s)}]),onMouseDown:q,onTouchStart:q,onClick:A?R:void 0,ref:b,...m,children:f})}const jc=W.memo(OE(LB));function IB({data:e,isConnectable:t,sourcePosition:n=Ce.Bottom}){return N.jsxs(N.Fragment,{children:[e==null?void 0:e.label,N.jsx(jc,{type:"source",position:n,isConnectable:t})]})}function BB({data:e,isConnectable:t,targetPosition:n=Ce.Top,sourcePosition:r=Ce.Bottom}){return N.jsxs(N.Fragment,{children:[N.jsx(jc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,N.jsx(jc,{type:"source",position:r,isConnectable:t})]})}function FB(){return null}function PB({data:e,isConnectable:t,targetPosition:n=Ce.Top}){return N.jsxs(N.Fragment,{children:[N.jsx(jc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const zc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},xw={input:IB,default:BB,output:PB,group:FB};function UB(e){var t,n,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const HB=e=>{const{width:t,height:n,x:r,y:s}=po(e.nodeLookup,{filter:l=>!!l.selected});return{width:qn(t)?t:null,height:qn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function $B({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ht(),{width:s,height:l,transformString:o,userSelectionActive:c}=Ge(HB,yt),f=DE(),d=W.useRef(null);if(W.useEffect(()=>{var m;n||(m=d.current)==null||m.focus({preventScroll:!0})},[n]),RE({nodeRef:d}),c||!s||!l)return null;const p=e?m=>{const b=r.getState().nodes.filter(x=>x.selected);e(m,b)}:void 0,g=m=>{Object.prototype.hasOwnProperty.call(zc,m.key)&&(m.preventDefault(),f({direction:zc[m.key],factor:m.shiftKey?4:1}))};return N.jsx("div",{className:Nt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:N.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:s,height:l}})})}const ww=typeof window<"u"?window:void 0,VB=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function zE({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:l,onPaneScroll:o,paneClickDistance:c,deleteKeyCode:f,selectionKeyCode:d,selectionOnDrag:p,selectionMode:g,onSelectionStart:m,onSelectionEnd:b,multiSelectionKeyCode:x,panActivationKeyCode:w,zoomActivationKeyCode:_,elementsSelectable:k,zoomOnScroll:A,zoomOnPinch:S,panOnScroll:O,panOnScrollSpeed:D,panOnScrollMode:M,zoomOnDoubleClick:F,panOnDrag:L,defaultViewport:U,translateExtent:j,minZoom:H,maxZoom:B,preventScrolling:q,onSelectionContextMenu:R,noWheelClassName:$,noPanClassName:I,disableKeyboardA11y:P,onViewportChange:Y,isControlledViewport:X}){const{nodesSelectionActive:E,userSelectionActive:G}=Ge(VB),te=ao(d,{target:ww}),T=ao(w,{target:ww}),V=T||L,K=T||O,J=p&&V!==!0,le=te||G||J;return kB({deleteKeyCode:f,multiSelectionKeyCode:x}),N.jsx(TB,{onPaneContextMenu:l,elementsSelectable:k,zoomOnScroll:A,zoomOnPinch:S,panOnScroll:K,panOnScrollSpeed:D,panOnScrollMode:M,zoomOnDoubleClick:F,panOnDrag:!te&&V,defaultViewport:U,translateExtent:j,minZoom:H,maxZoom:B,zoomActivationKeyCode:_,preventScrolling:q,noWheelClassName:$,noPanClassName:I,onViewportChange:Y,isControlledViewport:X,paneClickDistance:c,children:N.jsxs(MB,{onSelectionStart:m,onSelectionEnd:b,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:l,onPaneScroll:o,panOnDrag:V,isSelecting:!!le,selectionMode:g,selectionKeyPressed:te,selectionOnDrag:J,children:[e,E&&N.jsx($B,{onSelectionContextMenu:R,noPanClassName:I,disableKeyboardA11y:P})]})})}zE.displayName="FlowRenderer";const qB=W.memo(zE),GB=e=>t=>e?Jk(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function ZB(e){return Ge(W.useCallback(GB(e),[e]),yt)}const YB=e=>e.updateNodeInternals;function XB(){const e=Ge(YB),[t]=W.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(s=>{const l=s.target.getAttribute("data-id");r.set(l,{id:l,nodeElement:s.target,force:!0})}),e(r)}));return W.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function QB({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=ht(),l=W.useRef(null),o=W.useRef(null),c=W.useRef(e.sourcePosition),f=W.useRef(e.targetPosition),d=W.useRef(t),p=n&&!!e.internals.handleBounds;return W.useEffect(()=>{l.current&&!e.hidden&&(!p||o.current!==l.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(l.current),o.current=l.current)},[p,e.hidden]),W.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),W.useEffect(()=>{if(l.current){const g=d.current!==t,m=c.current!==e.sourcePosition,b=f.current!==e.targetPosition;(g||m||b)&&(d.current=t,c.current=e.sourcePosition,f.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:l.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),l}function KB({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:l,onDoubleClick:o,nodesDraggable:c,elementsSelectable:f,nodesConnectable:d,nodesFocusable:p,resizeObserver:g,noDragClassName:m,noPanClassName:b,disableKeyboardA11y:x,rfId:w,nodeTypes:_,nodeClickDistance:k,onError:A}){const{node:S,internals:O,isParent:D}=Ge(le=>{const fe=le.nodeLookup.get(e),ye=le.parentLookup.has(e);return{node:fe,internals:fe.internals,isParent:ye}},yt);let M=S.type||"default",F=(_==null?void 0:_[M])||xw[M];F===void 0&&(A==null||A("003",or.error003(M)),M="default",F=xw.default);const L=!!(S.draggable||c&&typeof S.draggable>"u"),U=!!(S.selectable||f&&typeof S.selectable>"u"),j=!!(S.connectable||d&&typeof S.connectable>"u"),H=!!(S.focusable||p&&typeof S.focusable>"u"),B=ht(),q=rE(S),R=QB({node:S,nodeType:M,hasDimensions:q,resizeObserver:g}),$=RE({nodeRef:R,disabled:S.hidden||!L,noDragClassName:m,handleSelector:S.dragHandle,nodeId:e,isSelectable:U,nodeClickDistance:k}),I=DE();if(S.hidden)return null;const P=Ir(S),Y=UB(S),X=U||L||t||n||r||s,E=n?le=>n(le,{...O.userNode}):void 0,G=r?le=>r(le,{...O.userNode}):void 0,te=s?le=>s(le,{...O.userNode}):void 0,T=l?le=>l(le,{...O.userNode}):void 0,V=o?le=>o(le,{...O.userNode}):void 0,K=le=>{const{selectNodesOnDrag:fe,nodeDragThreshold:ye}=B.getState();U&&(!fe||!L||ye>0)&&tm({id:e,store:B,nodeRef:R}),t&&t(le,{...O.userNode})},J=le=>{if(!(sE(le.nativeEvent)||x))if(Yk.includes(le.key)&&U){const fe=le.key==="Escape";tm({id:e,store:B,unselect:fe,nodeRef:R})}else L&&S.selected&&Object.prototype.hasOwnProperty.call(zc,le.key)&&(le.preventDefault(),B.setState({ariaLiveMessage:`Moved selected node ${le.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~O.positionAbsolute.x}, y: ${~~O.positionAbsolute.y}`}),I({direction:zc[le.key],factor:le.shiftKey?4:1}))};return N.jsx("div",{className:Nt(["react-flow__node",`react-flow__node-${M}`,{[b]:L},S.className,{selected:S.selected,selectable:U,parent:D,draggable:L,dragging:$}]),ref:R,style:{zIndex:O.z,transform:`translate(${O.positionAbsolute.x}px,${O.positionAbsolute.y}px)`,pointerEvents:X?"all":"none",visibility:q?"visible":"hidden",...S.style,...Y},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:E,onMouseMove:G,onMouseLeave:te,onContextMenu:T,onClick:K,onDoubleClick:V,onKeyDown:H?J:void 0,tabIndex:H?0:void 0,role:H?"button":void 0,"aria-describedby":x?void 0:`${kE}-${w}`,"aria-label":S.ariaLabel,children:N.jsx(DB,{value:e,children:N.jsx(F,{id:e,data:S.data,type:M,positionAbsoluteX:O.positionAbsolute.x,positionAbsoluteY:O.positionAbsolute.y,selected:S.selected??!1,selectable:U,draggable:L,deletable:S.deletable??!0,isConnectable:j,sourcePosition:S.sourcePosition,targetPosition:S.targetPosition,dragging:$,dragHandle:S.dragHandle,zIndex:O.z,parentId:S.parentId,...P})})})}const JB=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function LE(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:l}=Ge(JB,yt),o=ZB(e.onlyRenderVisibleElements),c=XB();return N.jsx("div",{className:"react-flow__nodes",style:lf,children:o.map(f=>N.jsx(KB,{id:f,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:l},f))})}LE.displayName="NodeRenderer";const WB=W.memo(LE);function e7(e){return Ge(W.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const r=[];if(n.width&&n.height)for(const s of n.edges){const l=n.nodeLookup.get(s.source),o=n.nodeLookup.get(s.target);l&&o&&t8({sourceNode:l,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),yt)}const t7=({color:e="none",strokeWidth:t=1})=>N.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),n7=({color:e="none",strokeWidth:t=1})=>N.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),_w={[Oc.Arrow]:t7,[Oc.ArrowClosed]:n7};function r7(e){const t=ht();return W.useMemo(()=>{var s,l;return Object.prototype.hasOwnProperty.call(_w,e)?_w[e]:((l=(s=t.getState()).onError)==null||l.call(s,"009",or.error009(e)),null)},[e])}const i7=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:l="strokeWidth",strokeWidth:o,orient:c="auto-start-reverse"})=>{const f=r7(t);return f?N.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:c,refX:"0",refY:"0",children:N.jsx(f,{color:n,strokeWidth:o})}):null},IE=({defaultColor:e,rfId:t})=>{const n=Ge(l=>l.edges),r=Ge(l=>l.defaultEdgeOptions),s=W.useMemo(()=>u8(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return s.length?N.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:N.jsx("defs",{children:s.map(l=>N.jsx(i7,{id:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,strokeWidth:l.strokeWidth,orient:l.orient},l.id))})}):null};IE.displayName="MarkerDefinitions";var a7=W.memo(IE);function BE({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:l,labelBgPadding:o=[2,4],labelBgBorderRadius:c=2,children:f,className:d,...p}){const[g,m]=W.useState({x:1,y:0,width:0,height:0}),b=Nt(["react-flow__edge-textwrapper",d]),x=W.useRef(null);return W.useEffect(()=>{if(x.current){const w=x.current.getBBox();m({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?N.jsxs("g",{transform:`translate(${e-g.width/2} ${t-g.height/2})`,className:b,visibility:g.width?"visible":"hidden",...p,children:[s&&N.jsx("rect",{width:g.width+2*o[0],x:-o[0],y:-o[1],height:g.height+2*o[1],className:"react-flow__edge-textbg",style:l,rx:c,ry:c}),N.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:x,style:r,children:n}),f]}):null}BE.displayName="EdgeText";const s7=W.memo(BE);function of({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:l,labelBgStyle:o,labelBgPadding:c,labelBgBorderRadius:f,interactionWidth:d=20,...p}){return N.jsxs(N.Fragment,{children:[N.jsx("path",{...p,d:e,fill:"none",className:Nt(["react-flow__edge-path",p.className])}),d&&N.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}),r&&qn(t)&&qn(n)?N.jsx(s7,{x:t,y:n,label:r,labelStyle:s,labelShowBg:l,labelBgStyle:o,labelBgPadding:c,labelBgBorderRadius:f}):null]})}function Sw({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===Ce.Left||e===Ce.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function FE({sourceX:e,sourceY:t,sourcePosition:n=Ce.Bottom,targetX:r,targetY:s,targetPosition:l=Ce.Top}){const[o,c]=Sw({pos:n,x1:e,y1:t,x2:r,y2:s}),[f,d]=Sw({pos:l,x1:r,y1:s,x2:e,y2:t}),[p,g,m,b]=oE({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:o,sourceControlY:c,targetControlX:f,targetControlY:d});return[`M${e},${t} C${o},${c} ${f},${d} ${r},${s}`,p,g,m,b]}function PE(e){return W.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:l,sourcePosition:o,targetPosition:c,label:f,labelStyle:d,labelShowBg:p,labelBgStyle:g,labelBgPadding:m,labelBgBorderRadius:b,style:x,markerEnd:w,markerStart:_,interactionWidth:k})=>{const[A,S,O]=FE({sourceX:n,sourceY:r,sourcePosition:o,targetX:s,targetY:l,targetPosition:c}),D=e.isInternal?void 0:t;return N.jsx(of,{id:D,path:A,labelX:S,labelY:O,label:f,labelStyle:d,labelShowBg:p,labelBgStyle:g,labelBgPadding:m,labelBgBorderRadius:b,style:x,markerEnd:w,markerStart:_,interactionWidth:k})})}const l7=PE({isInternal:!1}),UE=PE({isInternal:!0});l7.displayName="SimpleBezierEdge";UE.displayName="SimpleBezierEdgeInternal";function HE(e){return W.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:l,label:o,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:g,style:m,sourcePosition:b=Ce.Bottom,targetPosition:x=Ce.Top,markerEnd:w,markerStart:_,pathOptions:k,interactionWidth:A})=>{const[S,O,D]=Kg({sourceX:n,sourceY:r,sourcePosition:b,targetX:s,targetY:l,targetPosition:x,borderRadius:k==null?void 0:k.borderRadius,offset:k==null?void 0:k.offset}),M=e.isInternal?void 0:t;return N.jsx(of,{id:M,path:S,labelX:O,labelY:D,label:o,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:g,style:m,markerEnd:w,markerStart:_,interactionWidth:A})})}const $E=HE({isInternal:!1}),VE=HE({isInternal:!0});$E.displayName="SmoothStepEdge";VE.displayName="SmoothStepEdgeInternal";function qE(e){return W.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return N.jsx($E,{...n,id:r,pathOptions:W.useMemo(()=>{var l;return{borderRadius:0,offset:(l=n.pathOptions)==null?void 0:l.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const o7=qE({isInternal:!1}),GE=qE({isInternal:!0});o7.displayName="StepEdge";GE.displayName="StepEdgeInternal";function ZE(e){return W.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:l,label:o,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:g,style:m,markerEnd:b,markerStart:x,interactionWidth:w})=>{const[_,k,A]=fE({sourceX:n,sourceY:r,targetX:s,targetY:l}),S=e.isInternal?void 0:t;return N.jsx(of,{id:S,path:_,labelX:k,labelY:A,label:o,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:g,style:m,markerEnd:b,markerStart:x,interactionWidth:w})})}const u7=ZE({isInternal:!1}),YE=ZE({isInternal:!0});u7.displayName="StraightEdge";YE.displayName="StraightEdgeInternal";function XE(e){return W.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:l,sourcePosition:o=Ce.Bottom,targetPosition:c=Ce.Top,label:f,labelStyle:d,labelShowBg:p,labelBgStyle:g,labelBgPadding:m,labelBgBorderRadius:b,style:x,markerEnd:w,markerStart:_,pathOptions:k,interactionWidth:A})=>{const[S,O,D]=uE({sourceX:n,sourceY:r,sourcePosition:o,targetX:s,targetY:l,targetPosition:c,curvature:k==null?void 0:k.curvature}),M=e.isInternal?void 0:t;return N.jsx(of,{id:M,path:S,labelX:O,labelY:D,label:f,labelStyle:d,labelShowBg:p,labelBgStyle:g,labelBgPadding:m,labelBgBorderRadius:b,style:x,markerEnd:w,markerStart:_,interactionWidth:A})})}const c7=XE({isInternal:!1}),QE=XE({isInternal:!0});c7.displayName="BezierEdge";QE.displayName="BezierEdgeInternal";const kw={default:QE,straight:YE,step:GE,smoothstep:VE,simplebezier:UE},Ew={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},f7=(e,t,n)=>n===Ce.Left?e-t:n===Ce.Right?e+t:e,d7=(e,t,n)=>n===Ce.Top?e-t:n===Ce.Bottom?e+t:e,Aw="react-flow__edgeupdater";function Tw({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:l,onMouseOut:o,type:c}){return N.jsx("circle",{onMouseDown:s,onMouseEnter:l,onMouseOut:o,className:Nt([Aw,`${Aw}-${c}`]),cx:f7(t,r,e),cy:d7(n,r,e),r,stroke:"transparent",fill:"transparent"})}function h7({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:l,targetY:o,sourcePosition:c,targetPosition:f,onReconnect:d,onReconnectStart:p,onReconnectEnd:g,setReconnecting:m,setUpdateHover:b}){const x=ht(),w=(O,D)=>{if(O.button!==0)return;const{autoPanOnConnect:M,domNode:F,isValidConnection:L,connectionMode:U,connectionRadius:j,lib:H,onConnectStart:B,onConnectEnd:q,cancelConnection:R,nodeLookup:$,rfId:I,panBy:P,updateConnection:Y}=x.getState(),X=D.type==="target";m(!0),p==null||p(O,n,D.type);const E=(te,T)=>{m(!1),g==null||g(te,n,D.type,T)},G=te=>d==null?void 0:d(n,te);em.onPointerDown(O.nativeEvent,{autoPanOnConnect:M,connectionMode:U,connectionRadius:j,domNode:F,handleId:D.id,nodeId:D.nodeId,nodeLookup:$,isTarget:X,edgeUpdaterType:D.type,lib:H,flowId:I,cancelConnection:R,panBy:P,isValidConnection:L,onConnect:G,onConnectStart:B,onConnectEnd:q,onReconnectEnd:E,updateConnection:Y,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle})},_=O=>w(O,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),k=O=>w(O,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),A=()=>b(!0),S=()=>b(!1);return N.jsxs(N.Fragment,{children:[(e===!0||e==="source")&&N.jsx(Tw,{position:c,centerX:r,centerY:s,radius:t,onMouseDown:_,onMouseEnter:A,onMouseOut:S,type:"source"}),(e===!0||e==="target")&&N.jsx(Tw,{position:f,centerX:l,centerY:o,radius:t,onMouseDown:k,onMouseEnter:A,onMouseOut:S,type:"target"})]})}function p7({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:l,onContextMenu:o,onMouseEnter:c,onMouseMove:f,onMouseLeave:d,reconnectRadius:p,onReconnect:g,onReconnectStart:m,onReconnectEnd:b,rfId:x,edgeTypes:w,noPanClassName:_,onError:k,disableKeyboardA11y:A}){let S=Ge(be=>be.edgeLookup.get(e));const O=Ge(be=>be.defaultEdgeOptions);S=O?{...O,...S}:S;let D=S.type||"default",M=(w==null?void 0:w[D])||kw[D];M===void 0&&(k==null||k("011",or.error011(D)),D="default",M=kw.default);const F=!!(S.focusable||t&&typeof S.focusable>"u"),L=typeof g<"u"&&(S.reconnectable||n&&typeof S.reconnectable>"u"),U=!!(S.selectable||r&&typeof S.selectable>"u"),j=W.useRef(null),[H,B]=W.useState(!1),[q,R]=W.useState(!1),$=ht(),{zIndex:I,sourceX:P,sourceY:Y,targetX:X,targetY:E,sourcePosition:G,targetPosition:te}=Ge(W.useCallback(be=>{const je=be.nodeLookup.get(S.source),ze=be.nodeLookup.get(S.target);if(!je||!ze)return{zIndex:S.zIndex,...Ew};const lt=o8({id:e,sourceNode:je,targetNode:ze,sourceHandle:S.sourceHandle||null,targetHandle:S.targetHandle||null,connectionMode:be.connectionMode,onError:k});return{zIndex:e8({selected:S.selected,zIndex:S.zIndex,sourceNode:je,targetNode:ze,elevateOnSelect:be.elevateEdgesOnSelect}),...lt||Ew}},[S.source,S.target,S.sourceHandle,S.targetHandle,S.selected,S.zIndex]),yt),T=W.useMemo(()=>S.markerStart?`url('#${Jg(S.markerStart,x)}')`:void 0,[S.markerStart,x]),V=W.useMemo(()=>S.markerEnd?`url('#${Jg(S.markerEnd,x)}')`:void 0,[S.markerEnd,x]);if(S.hidden||P===null||Y===null||X===null||E===null)return null;const K=be=>{var ft;const{addSelectedEdges:je,unselectNodesAndEdges:ze,multiSelectionActive:lt}=$.getState();U&&($.setState({nodesSelectionActive:!1}),S.selected&<?(ze({nodes:[],edges:[S]}),(ft=j.current)==null||ft.blur()):je([e])),s&&s(be,S)},J=l?be=>{l(be,{...S})}:void 0,le=o?be=>{o(be,{...S})}:void 0,fe=c?be=>{c(be,{...S})}:void 0,ye=f?be=>{f(be,{...S})}:void 0,Ae=d?be=>{d(be,{...S})}:void 0,Se=be=>{var je;if(!A&&Yk.includes(be.key)&&U){const{unselectNodesAndEdges:ze,addSelectedEdges:lt}=$.getState();be.key==="Escape"?((je=j.current)==null||je.blur(),ze({edges:[S]})):lt([e])}};return N.jsx("svg",{style:{zIndex:I},children:N.jsxs("g",{className:Nt(["react-flow__edge",`react-flow__edge-${D}`,S.className,_,{selected:S.selected,animated:S.animated,inactive:!U&&!s,updating:H,selectable:U}]),onClick:K,onDoubleClick:J,onContextMenu:le,onMouseEnter:fe,onMouseMove:ye,onMouseLeave:Ae,onKeyDown:F?Se:void 0,tabIndex:F?0:void 0,role:F?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":S.ariaLabel===null?void 0:S.ariaLabel||`Edge from ${S.source} to ${S.target}`,"aria-describedby":F?`${EE}-${x}`:void 0,ref:j,children:[!q&&N.jsx(M,{id:e,source:S.source,target:S.target,type:S.type,selected:S.selected,animated:S.animated,selectable:U,deletable:S.deletable??!0,label:S.label,labelStyle:S.labelStyle,labelShowBg:S.labelShowBg,labelBgStyle:S.labelBgStyle,labelBgPadding:S.labelBgPadding,labelBgBorderRadius:S.labelBgBorderRadius,sourceX:P,sourceY:Y,targetX:X,targetY:E,sourcePosition:G,targetPosition:te,data:S.data,style:S.style,sourceHandleId:S.sourceHandle,targetHandleId:S.targetHandle,markerStart:T,markerEnd:V,pathOptions:"pathOptions"in S?S.pathOptions:void 0,interactionWidth:S.interactionWidth}),L&&N.jsx(h7,{edge:S,isReconnectable:L,reconnectRadius:p,onReconnect:g,onReconnectStart:m,onReconnectEnd:b,sourceX:P,sourceY:Y,targetX:X,targetY:E,sourcePosition:G,targetPosition:te,setUpdateHover:B,setReconnecting:R})]})})}const g7=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function KE({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:l,onEdgeContextMenu:o,onEdgeMouseEnter:c,onEdgeMouseMove:f,onEdgeMouseLeave:d,onEdgeClick:p,reconnectRadius:g,onEdgeDoubleClick:m,onReconnectStart:b,onReconnectEnd:x,disableKeyboardA11y:w}){const{edgesFocusable:_,edgesReconnectable:k,elementsSelectable:A,onError:S}=Ge(g7,yt),O=e7(t);return N.jsxs("div",{className:"react-flow__edges",children:[N.jsx(a7,{defaultColor:e,rfId:n}),O.map(D=>N.jsx(p7,{id:D,edgesFocusable:_,edgesReconnectable:k,elementsSelectable:A,noPanClassName:s,onReconnect:l,onContextMenu:o,onMouseEnter:c,onMouseMove:f,onMouseLeave:d,onClick:p,reconnectRadius:g,onDoubleClick:m,onReconnectStart:b,onReconnectEnd:x,rfId:n,onError:S,edgeTypes:r,disableKeyboardA11y:w},D))]})}KE.displayName="EdgeRenderer";const m7=W.memo(KE),y7=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function b7({children:e}){const t=Ge(y7);return N.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function v7(e){const t=sf(),n=W.useRef(!1);W.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const x7=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function w7(e){const t=Ge(x7),n=ht();return W.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function _7(e){return e.connection.inProgress?{...e.connection,to:go(e.connection.to,e.transform)}:{...e.connection}}function S7(e){return _7}function k7(e){const t=S7();return Ge(t,yt)}const E7=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function A7({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:l,height:o,isValid:c,inProgress:f}=Ge(E7,yt);return!(l&&s&&f)?null:N.jsx("svg",{style:e,width:l,height:o,className:"react-flow__connectionline react-flow__container",children:N.jsx("g",{className:Nt(["react-flow__connection",Qk(c)]),children:N.jsx(JE,{style:t,type:n,CustomComponent:r,isValid:c})})})}const JE=({style:e,type:t=bi.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:l,fromNode:o,fromHandle:c,fromPosition:f,to:d,toNode:p,toHandle:g,toPosition:m}=k7();if(!s)return;if(n)return N.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:c,fromX:l.x,fromY:l.y,toX:d.x,toY:d.y,fromPosition:f,toPosition:m,connectionStatus:Qk(r),toNode:p,toHandle:g});let b="";const x={sourceX:l.x,sourceY:l.y,sourcePosition:f,targetX:d.x,targetY:d.y,targetPosition:m};switch(t){case bi.Bezier:[b]=uE(x);break;case bi.SimpleBezier:[b]=FE(x);break;case bi.Step:[b]=Kg({...x,borderRadius:0});break;case bi.SmoothStep:[b]=Kg(x);break;default:[b]=fE(x)}return N.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};JE.displayName="ConnectionLine";const T7={};function Nw(e=T7){W.useRef(e),ht(),W.useEffect(()=>{},[e])}function N7(){ht(),W.useRef(!1),W.useEffect(()=>{},[])}function WE({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:l,onEdgeDoubleClick:o,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:d,onNodeContextMenu:p,onSelectionContextMenu:g,onSelectionStart:m,onSelectionEnd:b,connectionLineType:x,connectionLineStyle:w,connectionLineComponent:_,connectionLineContainerStyle:k,selectionKeyCode:A,selectionOnDrag:S,selectionMode:O,multiSelectionKeyCode:D,panActivationKeyCode:M,zoomActivationKeyCode:F,deleteKeyCode:L,onlyRenderVisibleElements:U,elementsSelectable:j,defaultViewport:H,translateExtent:B,minZoom:q,maxZoom:R,preventScrolling:$,defaultMarkerColor:I,zoomOnScroll:P,zoomOnPinch:Y,panOnScroll:X,panOnScrollSpeed:E,panOnScrollMode:G,zoomOnDoubleClick:te,panOnDrag:T,onPaneClick:V,onPaneMouseEnter:K,onPaneMouseMove:J,onPaneMouseLeave:le,onPaneScroll:fe,onPaneContextMenu:ye,paneClickDistance:Ae,nodeClickDistance:Se,onEdgeContextMenu:be,onEdgeMouseEnter:je,onEdgeMouseMove:ze,onEdgeMouseLeave:lt,reconnectRadius:ft,onReconnect:xt,onReconnectStart:Ai,onReconnectEnd:fr,noDragClassName:Dn,noWheelClassName:Xn,noPanClassName:dr,disableKeyboardA11y:Qn,nodeExtent:Ti,rfId:Kn,viewport:se,onViewportChange:he}){return Nw(e),Nw(t),N7(),v7(n),w7(se),N.jsx(qB,{onPaneClick:V,onPaneMouseEnter:K,onPaneMouseMove:J,onPaneMouseLeave:le,onPaneContextMenu:ye,onPaneScroll:fe,paneClickDistance:Ae,deleteKeyCode:L,selectionKeyCode:A,selectionOnDrag:S,selectionMode:O,onSelectionStart:m,onSelectionEnd:b,multiSelectionKeyCode:D,panActivationKeyCode:M,zoomActivationKeyCode:F,elementsSelectable:j,zoomOnScroll:P,zoomOnPinch:Y,zoomOnDoubleClick:te,panOnScroll:X,panOnScrollSpeed:E,panOnScrollMode:G,panOnDrag:T,defaultViewport:H,translateExtent:B,minZoom:q,maxZoom:R,onSelectionContextMenu:g,preventScrolling:$,noDragClassName:Dn,noWheelClassName:Xn,noPanClassName:dr,disableKeyboardA11y:Qn,onViewportChange:he,isControlledViewport:!!se,children:N.jsxs(b7,{children:[N.jsx(m7,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:o,onReconnect:xt,onReconnectStart:Ai,onReconnectEnd:fr,onlyRenderVisibleElements:U,onEdgeContextMenu:be,onEdgeMouseEnter:je,onEdgeMouseMove:ze,onEdgeMouseLeave:lt,reconnectRadius:ft,defaultMarkerColor:I,noPanClassName:dr,disableKeyboardA11y:Qn,rfId:Kn}),N.jsx(A7,{style:w,type:x,component:_,containerStyle:k}),N.jsx("div",{className:"react-flow__edgelabel-renderer"}),N.jsx(WB,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:d,onNodeContextMenu:p,nodeClickDistance:Se,onlyRenderVisibleElements:U,noPanClassName:dr,noDragClassName:Dn,disableKeyboardA11y:Qn,nodeExtent:Ti,rfId:Kn}),N.jsx("div",{className:"react-flow__viewport-portal"})]})})}WE.displayName="GraphView";const C7=W.memo(WE),Cw=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:l,fitView:o,fitViewOptions:c,minZoom:f=.5,maxZoom:d=2,nodeOrigin:p,nodeExtent:g}={})=>{const m=new Map,b=new Map,x=new Map,w=new Map,_=r??t??[],k=n??e??[],A=p??[0,0],S=g??to;hE(x,w,_);const O=Wg(k,m,b,{nodeOrigin:A,nodeExtent:S,elevateNodesOnSelect:!1});let D=[0,0,1];if(o&&s&&l){const M=po(m,{filter:j=>!!((j.width||j.initialWidth)&&(j.height||j.initialHeight))}),{x:F,y:L,zoom:U}=Lm(M,s,l,f,d,(c==null?void 0:c.padding)??.1);D=[F,L,U]}return{rfId:"1",width:0,height:0,transform:D,nodes:k,nodesInitialized:O,nodeLookup:m,parentLookup:b,edges:_,edgeLookup:w,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:f,maxZoom:d,translateExtent:to,nodeExtent:S,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:gs.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:A,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:c,fitViewResolver:null,connection:{...Xk},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:X6,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},O7=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:l,fitView:o,fitViewOptions:c,minZoom:f,maxZoom:d,nodeOrigin:p,nodeExtent:g})=>Q8((m,b)=>{async function x(){const{nodeLookup:w,panZoom:_,fitViewOptions:k,fitViewResolver:A,width:S,height:O,minZoom:D,maxZoom:M}=b();_&&(await Z6({nodes:w,width:S,height:O,panZoom:_,minZoom:D,maxZoom:M},k),A==null||A.resolve(!0),m({fitViewResolver:null}))}return{...Cw({nodes:e,edges:t,width:s,height:l,fitView:o,fitViewOptions:c,minZoom:f,maxZoom:d,nodeOrigin:p,nodeExtent:g,defaultNodes:n,defaultEdges:r}),setNodes:w=>{const{nodeLookup:_,parentLookup:k,nodeOrigin:A,elevateNodesOnSelect:S,fitViewQueued:O}=b(),D=Wg(w,_,k,{nodeOrigin:A,nodeExtent:g,elevateNodesOnSelect:S,checkEquality:!0});O&&D?(x(),m({nodes:w,nodesInitialized:D,fitViewQueued:!1,fitViewOptions:void 0})):m({nodes:w,nodesInitialized:D})},setEdges:w=>{const{connectionLookup:_,edgeLookup:k}=b();hE(_,k,w),m({edges:w})},setDefaultNodesAndEdges:(w,_)=>{if(w){const{setNodes:k}=b();k(w),m({hasDefaultNodes:!0})}if(_){const{setEdges:k}=b();k(_),m({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:_,nodeLookup:k,parentLookup:A,domNode:S,nodeOrigin:O,nodeExtent:D,debug:M,fitViewQueued:F}=b(),{changes:L,updatedInternals:U}=p8(w,k,A,S,O,D);U&&(f8(k,A,{nodeOrigin:O,nodeExtent:D}),F?(x(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(L==null?void 0:L.length)>0&&(M&&console.log("React Flow: trigger node changes",L),_==null||_(L)))},updateNodePositions:(w,_=!1)=>{const k=[],A=[],{nodeLookup:S,triggerNodeChanges:O}=b();for(const[D,M]of w){const F=S.get(D),L=!!(F!=null&&F.expandParent&&(F!=null&&F.parentId)&&(M!=null&&M.position)),U={id:D,type:"position",position:L?{x:Math.max(0,M.position.x),y:Math.max(0,M.position.y)}:M.position,dragging:_};L&&F.parentId&&k.push({id:D,parentId:F.parentId,rect:{...M.internals.positionAbsolute,width:M.measured.width??0,height:M.measured.height??0}}),A.push(U)}if(k.length>0){const{parentLookup:D,nodeOrigin:M}=b(),F=Um(k,S,D,M);A.push(...F)}O(A)},triggerNodeChanges:w=>{const{onNodesChange:_,setNodes:k,nodes:A,hasDefaultNodes:S,debug:O}=b();if(w!=null&&w.length){if(S){const D=NE(w,A);k(D)}O&&console.log("React Flow: trigger node changes",w),_==null||_(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:_,setEdges:k,edges:A,hasDefaultEdges:S,debug:O}=b();if(w!=null&&w.length){if(S){const D=CE(w,A);k(D)}O&&console.log("React Flow: trigger edge changes",w),_==null||_(w)}},addSelectedNodes:w=>{const{multiSelectionActive:_,edgeLookup:k,nodeLookup:A,triggerNodeChanges:S,triggerEdgeChanges:O}=b();if(_){const D=w.map(M=>Yi(M,!0));S(D);return}S(ns(A,new Set([...w]),!0)),O(ns(k))},addSelectedEdges:w=>{const{multiSelectionActive:_,edgeLookup:k,nodeLookup:A,triggerNodeChanges:S,triggerEdgeChanges:O}=b();if(_){const D=w.map(M=>Yi(M,!0));O(D);return}O(ns(k,new Set([...w]))),S(ns(A,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:_}={})=>{const{edges:k,nodes:A,nodeLookup:S,triggerNodeChanges:O,triggerEdgeChanges:D}=b(),M=w||A,F=_||k,L=M.map(j=>{const H=S.get(j.id);return H&&(H.selected=!1),Yi(j.id,!1)}),U=F.map(j=>Yi(j.id,!1));O(L),D(U)},setMinZoom:w=>{const{panZoom:_,maxZoom:k}=b();_==null||_.setScaleExtent([w,k]),m({minZoom:w})},setMaxZoom:w=>{const{panZoom:_,minZoom:k}=b();_==null||_.setScaleExtent([k,w]),m({maxZoom:w})},setTranslateExtent:w=>{var _;(_=b().panZoom)==null||_.setTranslateExtent(w),m({translateExtent:w})},setPaneClickDistance:w=>{var _;(_=b().panZoom)==null||_.setClickDistance(w)},resetSelectedElements:()=>{const{edges:w,nodes:_,triggerNodeChanges:k,triggerEdgeChanges:A,elementsSelectable:S}=b();if(!S)return;const O=_.reduce((M,F)=>F.selected?[...M,Yi(F.id,!1)]:M,[]),D=w.reduce((M,F)=>F.selected?[...M,Yi(F.id,!1)]:M,[]);k(O),A(D)},setNodeExtent:w=>{const{nodes:_,nodeLookup:k,parentLookup:A,nodeOrigin:S,elevateNodesOnSelect:O,nodeExtent:D}=b();w[0][0]===D[0][0]&&w[0][1]===D[0][1]&&w[1][0]===D[1][0]&&w[1][1]===D[1][1]||(Wg(_,k,A,{nodeOrigin:S,nodeExtent:w,elevateNodesOnSelect:O,checkEquality:!1}),m({nodeExtent:w}))},panBy:w=>{const{transform:_,width:k,height:A,panZoom:S,translateExtent:O}=b();return g8({delta:w,panZoom:S,transform:_,translateExtent:O,width:k,height:A})},cancelConnection:()=>{m({connection:{...Xk}})},updateConnection:w=>{m({connection:w})},reset:()=>m({...Cw()})}},Object.is);function e2({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:l,initialMinZoom:o,initialMaxZoom:c,initialFitViewOptions:f,fitView:d,nodeOrigin:p,nodeExtent:g,children:m}){const[b]=W.useState(()=>O7({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:l,fitView:d,minZoom:o,maxZoom:c,fitViewOptions:f,nodeOrigin:p,nodeExtent:g}));return N.jsx(K8,{value:b,children:N.jsx(xB,{children:m})})}function M7({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:l,height:o,fitView:c,fitViewOptions:f,minZoom:d,maxZoom:p,nodeOrigin:g,nodeExtent:m}){return W.useContext(af)?N.jsx(N.Fragment,{children:e}):N.jsx(e2,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:l,initialHeight:o,fitView:c,initialFitViewOptions:f,initialMinZoom:d,initialMaxZoom:p,nodeOrigin:g,nodeExtent:m,children:e})}const R7={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function D7({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:l,edgeTypes:o,onNodeClick:c,onEdgeClick:f,onInit:d,onMove:p,onMoveStart:g,onMoveEnd:m,onConnect:b,onConnectStart:x,onConnectEnd:w,onClickConnectStart:_,onClickConnectEnd:k,onNodeMouseEnter:A,onNodeMouseMove:S,onNodeMouseLeave:O,onNodeContextMenu:D,onNodeDoubleClick:M,onNodeDragStart:F,onNodeDrag:L,onNodeDragStop:U,onNodesDelete:j,onEdgesDelete:H,onDelete:B,onSelectionChange:q,onSelectionDragStart:R,onSelectionDrag:$,onSelectionDragStop:I,onSelectionContextMenu:P,onSelectionStart:Y,onSelectionEnd:X,onBeforeDelete:E,connectionMode:G,connectionLineType:te=bi.Bezier,connectionLineStyle:T,connectionLineComponent:V,connectionLineContainerStyle:K,deleteKeyCode:J="Backspace",selectionKeyCode:le="Shift",selectionOnDrag:fe=!1,selectionMode:ye=no.Full,panActivationKeyCode:Ae="Space",multiSelectionKeyCode:Se=Dc()?"Meta":"Control",zoomActivationKeyCode:be=Dc()?"Meta":"Control",snapToGrid:je,snapGrid:ze,onlyRenderVisibleElements:lt=!1,selectNodesOnDrag:ft,nodesDraggable:xt,nodesConnectable:Ai,nodesFocusable:fr,nodeOrigin:Dn=AE,edgesFocusable:Xn,edgesReconnectable:dr,elementsSelectable:Qn=!0,defaultViewport:Ti=cB,minZoom:Kn=.5,maxZoom:se=2,translateExtent:he=to,preventScrolling:Ee=!0,nodeExtent:Te,defaultMarkerColor:Qe="#b1b1b7",zoomOnScroll:Gt=!0,zoomOnPinch:jn=!0,panOnScroll:Pt=!1,panOnScrollSpeed:Sn=.5,panOnScrollMode:Zt=na.Free,zoomOnDoubleClick:wt=!0,panOnDrag:Kt=!0,onPaneClick:un,onPaneMouseEnter:yo,onPaneMouseMove:bo,onPaneMouseLeave:_s,onPaneScroll:Ni,onPaneContextMenu:uf,paneClickDistance:Ss=0,nodeClickDistance:vo=0,children:ks,onReconnect:Es,onReconnectStart:xo,onReconnectEnd:cf,onEdgeContextMenu:Jn,onEdgeDoubleClick:Mt,onEdgeMouseEnter:Ut,onEdgeMouseMove:Br,onEdgeMouseLeave:As,reconnectRadius:ff=10,onNodesChange:df,onEdgesChange:wo,noDragClassName:Ci="nodrag",noWheelClassName:Ts="nowheel",noPanClassName:hr="nopan",fitView:pr,fitViewOptions:Fr,connectOnClick:Pr,attributionPosition:_t,proOptions:_o,defaultEdgeOptions:So,elevateNodesOnSelect:gr,elevateEdgesOnSelect:Ur,disableKeyboardA11y:ko=!1,autoPanOnConnect:Eo,autoPanOnNodeDrag:Ao,autoPanSpeed:hf,connectionRadius:ua,isValidConnection:ca,onError:zn,style:Ns,id:Cs,nodeDragThreshold:Hr,viewport:Os,onViewportChange:Ms,width:pf,height:To,colorMode:Jt="light",debug:No,onScroll:fa,...da},Co){const $r=Cs||"1",gf=pB(Jt),Wt=W.useCallback(ha=>{ha.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),fa==null||fa(ha)},[fa]);return N.jsx("div",{"data-testid":"rf__wrapper",...da,onScroll:Wt,style:{...Ns,...R7},ref:Co,className:Nt(["react-flow",s,gf]),id:Cs,children:N.jsxs(M7,{nodes:e,edges:t,width:pf,height:To,fitView:pr,fitViewOptions:Fr,minZoom:Kn,maxZoom:se,nodeOrigin:Dn,nodeExtent:Te,children:[N.jsx(C7,{onInit:d,onNodeClick:c,onEdgeClick:f,onNodeMouseEnter:A,onNodeMouseMove:S,onNodeMouseLeave:O,onNodeContextMenu:D,onNodeDoubleClick:M,nodeTypes:l,edgeTypes:o,connectionLineType:te,connectionLineStyle:T,connectionLineComponent:V,connectionLineContainerStyle:K,selectionKeyCode:le,selectionOnDrag:fe,selectionMode:ye,deleteKeyCode:J,multiSelectionKeyCode:Se,panActivationKeyCode:Ae,zoomActivationKeyCode:be,onlyRenderVisibleElements:lt,defaultViewport:Ti,translateExtent:he,minZoom:Kn,maxZoom:se,preventScrolling:Ee,zoomOnScroll:Gt,zoomOnPinch:jn,zoomOnDoubleClick:wt,panOnScroll:Pt,panOnScrollSpeed:Sn,panOnScrollMode:Zt,panOnDrag:Kt,onPaneClick:un,onPaneMouseEnter:yo,onPaneMouseMove:bo,onPaneMouseLeave:_s,onPaneScroll:Ni,onPaneContextMenu:uf,paneClickDistance:Ss,nodeClickDistance:vo,onSelectionContextMenu:P,onSelectionStart:Y,onSelectionEnd:X,onReconnect:Es,onReconnectStart:xo,onReconnectEnd:cf,onEdgeContextMenu:Jn,onEdgeDoubleClick:Mt,onEdgeMouseEnter:Ut,onEdgeMouseMove:Br,onEdgeMouseLeave:As,reconnectRadius:ff,defaultMarkerColor:Qe,noDragClassName:Ci,noWheelClassName:Ts,noPanClassName:hr,rfId:$r,disableKeyboardA11y:ko,nodeExtent:Te,viewport:Os,onViewportChange:Ms}),N.jsx(hB,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:b,onConnectStart:x,onConnectEnd:w,onClickConnectStart:_,onClickConnectEnd:k,nodesDraggable:xt,nodesConnectable:Ai,nodesFocusable:fr,edgesFocusable:Xn,edgesReconnectable:dr,elementsSelectable:Qn,elevateNodesOnSelect:gr,elevateEdgesOnSelect:Ur,minZoom:Kn,maxZoom:se,nodeExtent:Te,onNodesChange:df,onEdgesChange:wo,snapToGrid:je,snapGrid:ze,connectionMode:G,translateExtent:he,connectOnClick:Pr,defaultEdgeOptions:So,fitView:pr,fitViewOptions:Fr,onNodesDelete:j,onEdgesDelete:H,onDelete:B,onNodeDragStart:F,onNodeDrag:L,onNodeDragStop:U,onSelectionDrag:$,onSelectionDragStart:R,onSelectionDragStop:I,onMove:p,onMoveStart:g,onMoveEnd:m,noPanClassName:hr,nodeOrigin:Dn,rfId:$r,autoPanOnConnect:Eo,autoPanOnNodeDrag:Ao,autoPanSpeed:hf,onError:zn,connectionRadius:ua,isValidConnection:ca,selectNodesOnDrag:ft,nodeDragThreshold:Hr,onBeforeDelete:E,paneClickDistance:Ss,debug:No}),N.jsx(uB,{onSelectionChange:q}),ks,N.jsx(iB,{proOptions:_o,position:_t}),N.jsx(nB,{rfId:$r,disableKeyboardA11y:ko})]})})}var j7=OE(D7);function z7(e){const[t,n]=W.useState(e),r=W.useCallback(s=>n(l=>NE(s,l)),[]);return[t,n,r]}function L7(e){const[t,n]=W.useState(e),r=W.useCallback(s=>n(l=>CE(s,l)),[]);return[t,n,r]}function I7({dimensions:e,lineWidth:t,variant:n,className:r}){return N.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Nt(["react-flow__background-pattern",n,r])})}function B7({radius:e,className:t}){return N.jsx("circle",{cx:e,cy:e,r:e,className:Nt(["react-flow__background-pattern","dots",t])})}var wi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(wi||(wi={}));const F7={[wi.Dots]:1,[wi.Lines]:1,[wi.Cross]:6},P7=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function t2({id:e,variant:t=wi.Dots,gap:n=20,size:r,lineWidth:s=1,offset:l=0,color:o,bgColor:c,style:f,className:d,patternClassName:p}){const g=W.useRef(null),{transform:m,patternId:b}=Ge(P7,yt),x=r||F7[t],w=t===wi.Dots,_=t===wi.Cross,k=Array.isArray(n)?n:[n,n],A=[k[0]*m[2]||1,k[1]*m[2]||1],S=x*m[2],O=Array.isArray(l)?l:[l,l],D=_?[S,S]:A,M=[O[0]*m[2]||1+D[0]/2,O[1]*m[2]||1+D[1]/2],F=`${b}${e||""}`;return N.jsxs("svg",{className:Nt(["react-flow__background",d]),style:{...f,...lf,"--xy-background-color-props":c,"--xy-background-pattern-color-props":o},ref:g,"data-testid":"rf__background",children:[N.jsx("pattern",{id:F,x:m[0]%A[0],y:m[1]%A[1],width:A[0],height:A[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${M[0]},-${M[1]})`,children:w?N.jsx(B7,{radius:S/2,className:p}):N.jsx(I7,{dimensions:D,lineWidth:s,variant:t,className:p})}),N.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${F})`})]})}t2.displayName="Background";const U7=W.memo(t2);function H7(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:N.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function $7(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:N.jsx("path",{d:"M0 0h32v4.2H0z"})})}function V7(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:N.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function q7(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:N.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function G7(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:N.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function tc({children:e,className:t,...n}){return N.jsx("button",{type:"button",className:Nt(["react-flow__controls-button",t]),...n,children:e})}const Z7=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function n2({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:l,onZoomOut:o,onFitView:c,onInteractiveChange:f,className:d,children:p,position:g="bottom-left",orientation:m="vertical","aria-label":b="React Flow controls"}){const x=ht(),{isInteractive:w,minZoomReached:_,maxZoomReached:k}=Ge(Z7,yt),{zoomIn:A,zoomOut:S,fitView:O}=sf(),D=()=>{A(),l==null||l()},M=()=>{S(),o==null||o()},F=()=>{O(s),c==null||c()},L=()=>{x.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),f==null||f(!w)},U=m==="horizontal"?"horizontal":"vertical";return N.jsxs(mo,{className:Nt(["react-flow__controls",U,d]),position:g,style:e,"data-testid":"rf__controls","aria-label":b,children:[t&&N.jsxs(N.Fragment,{children:[N.jsx(tc,{onClick:D,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:k,children:N.jsx(H7,{})}),N.jsx(tc,{onClick:M,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:_,children:N.jsx($7,{})})]}),n&&N.jsx(tc,{className:"react-flow__controls-fitview",onClick:F,title:"fit view","aria-label":"fit view",children:N.jsx(V7,{})}),r&&N.jsx(tc,{className:"react-flow__controls-interactive",onClick:L,title:"toggle interactivity","aria-label":"toggle interactivity",children:w?N.jsx(G7,{}):N.jsx(q7,{})}),p]})}n2.displayName="Controls";const Y7=W.memo(n2);function X7({id:e,x:t,y:n,width:r,height:s,style:l,color:o,strokeColor:c,strokeWidth:f,className:d,borderRadius:p,shapeRendering:g,selected:m,onClick:b}){const{background:x,backgroundColor:w}=l||{},_=o||x||w;return N.jsx("rect",{className:Nt(["react-flow__minimap-node",{selected:m},d]),x:t,y:n,rx:p,ry:p,width:r,height:s,style:{fill:_,stroke:c,strokeWidth:f},shapeRendering:g,onClick:b?k=>b(k,e):void 0})}const Q7=W.memo(X7),K7=e=>e.nodes.map(t=>t.id),xp=e=>e instanceof Function?e:()=>e;function J7({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:l=Q7,onClick:o}){const c=Ge(K7,yt),f=xp(t),d=xp(e),p=xp(n),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return N.jsx(N.Fragment,{children:c.map(m=>N.jsx(eF,{id:m,nodeColorFunc:f,nodeStrokeColorFunc:d,nodeClassNameFunc:p,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:l,onClick:o,shapeRendering:g},m))})}function W7({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:l,shapeRendering:o,NodeComponent:c,onClick:f}){const{node:d,x:p,y:g,width:m,height:b}=Ge(x=>{const{internals:w}=x.nodeLookup.get(e),_=w.userNode,{x:k,y:A}=w.positionAbsolute,{width:S,height:O}=Ir(_);return{node:_,x:k,y:A,width:S,height:O}},yt);return!d||d.hidden||!rE(d)?null:N.jsx(c,{x:p,y:g,width:m,height:b,style:d.style,selected:!!d.selected,className:r(d),color:t(d),borderRadius:s,strokeColor:n(d),strokeWidth:l,shapeRendering:o,onClick:f,id:d.id})}const eF=W.memo(W7);var tF=W.memo(J7);const nF=200,rF=150,iF=e=>!e.hidden,aF=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?nE(po(e.nodeLookup,{filter:iF}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},sF="react-flow__minimap-desc";function r2({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:l=5,nodeStrokeWidth:o,nodeComponent:c,bgColor:f,maskColor:d,maskStrokeColor:p,maskStrokeWidth:g,position:m="bottom-right",onClick:b,onNodeClick:x,pannable:w=!1,zoomable:_=!1,ariaLabel:k="React Flow mini map",inversePan:A,zoomStep:S=10,offsetScale:O=5}){const D=ht(),M=W.useRef(null),{boundingRect:F,viewBB:L,rfId:U,panZoom:j,translateExtent:H,flowWidth:B,flowHeight:q}=Ge(aF,yt),R=(e==null?void 0:e.width)??nF,$=(e==null?void 0:e.height)??rF,I=F.width/R,P=F.height/$,Y=Math.max(I,P),X=Y*R,E=Y*$,G=O*Y,te=F.x-(X-F.width)/2-G,T=F.y-(E-F.height)/2-G,V=X+G*2,K=E+G*2,J=`${sF}-${U}`,le=W.useRef(0),fe=W.useRef();le.current=Y,W.useEffect(()=>{if(M.current&&j)return fe.current=S8({domNode:M.current,panZoom:j,getTransform:()=>D.getState().transform,getViewScale:()=>le.current}),()=>{var Se;(Se=fe.current)==null||Se.destroy()}},[j]),W.useEffect(()=>{var Se;(Se=fe.current)==null||Se.update({translateExtent:H,width:B,height:q,inversePan:A,pannable:w,zoomStep:S,zoomable:_})},[w,_,A,S,H,B,q]);const ye=b?Se=>{var ze;const[be,je]=((ze=fe.current)==null?void 0:ze.pointer(Se))||[0,0];b(Se,{x:be,y:je})}:void 0,Ae=x?W.useCallback((Se,be)=>{const je=D.getState().nodeLookup.get(be).internals.userNode;x(Se,je)},[]):void 0;return N.jsx(mo,{position:m,style:{...e,"--xy-minimap-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*Y:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:Nt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:N.jsxs("svg",{width:R,height:$,viewBox:`${te} ${T} ${V} ${K}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":J,ref:M,onClick:ye,children:[k&&N.jsx("title",{id:J,children:k}),N.jsx(tF,{onClick:Ae,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:l,nodeClassName:s,nodeStrokeWidth:o,nodeComponent:c}),N.jsx("path",{className:"react-flow__minimap-mask",d:`M${te-G},${T-G}h${V+G*2}v${K+G*2}h${-V-G*2}z
|
|
244
|
+
M${L.x},${L.y}h${L.width}v${L.height}h${-L.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}r2.displayName="MiniMap";W.memo(r2);function lF({nodeId:e,position:t,variant:n=$l.Handle,className:r,style:s={},children:l,color:o,minWidth:c=10,minHeight:f=10,maxWidth:d=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:m,shouldResize:b,onResizeStart:x,onResize:w,onResizeEnd:_}){const k=jE(),A=typeof e=="string"?e:k,S=ht(),O=W.useRef(null),D=n===$l.Line?"right":"bottom-right",M=t??D,F=W.useRef(null);W.useEffect(()=>{if(!(!O.current||!A))return F.current||(F.current=B8({domNode:O.current,nodeId:A,getStoreItems:()=>{const{nodeLookup:H,transform:B,snapGrid:q,snapToGrid:R,nodeOrigin:$,domNode:I}=S.getState();return{nodeLookup:H,transform:B,snapGrid:q,snapToGrid:R,nodeOrigin:$,paneDomNode:I}},onChange:(H,B)=>{const{triggerNodeChanges:q,nodeLookup:R,parentLookup:$,nodeOrigin:I}=S.getState(),P=[],Y={x:H.x,y:H.y},X=R.get(A);if(X&&X.expandParent&&X.parentId){const E=X.origin??I,G=H.width??X.measured.width??0,te=H.height??X.measured.height??0,T={id:X.id,parentId:X.parentId,rect:{width:G,height:te,...iE({x:H.x??X.position.x,y:H.y??X.position.y},{width:G,height:te},X.parentId,R,E)}},V=Um([T],R,$,I);P.push(...V),Y.x=H.x?Math.max(E[0]*G,H.x):void 0,Y.y=H.y?Math.max(E[1]*te,H.y):void 0}if(Y.x!==void 0&&Y.y!==void 0){const E={id:A,type:"position",position:{...Y}};P.push(E)}if(H.width!==void 0&&H.height!==void 0){const G={id:A,type:"dimensions",resizing:!0,setAttributes:m?m==="horizontal"?"width":"height":!0,dimensions:{width:H.width,height:H.height}};P.push(G)}for(const E of B){const G={...E,type:"position"};P.push(G)}q(P)},onEnd:({width:H,height:B})=>{const q={id:A,type:"dimensions",resizing:!1,dimensions:{width:H,height:B}};S.getState().triggerNodeChanges([q])}})),F.current.update({controlPosition:M,boundaries:{minWidth:c,minHeight:f,maxWidth:d,maxHeight:p},keepAspectRatio:g,resizeDirection:m,onResizeStart:x,onResize:w,onResizeEnd:_,shouldResize:b}),()=>{var H;(H=F.current)==null||H.destroy()}},[M,c,f,d,p,g,x,w,_,b]);const L=M.split("-"),U=n===$l.Line?"borderColor":"backgroundColor",j=o?{...s,[U]:o}:s;return N.jsx("div",{className:Nt(["react-flow__resize-control","nodrag",...L,n,r]),ref:O,style:j,children:l})}W.memo(lF);var wp,Ow;function $m(){if(Ow)return wp;Ow=1;var e="\0",t="\0",n="";class r{constructor(p){ut(this,"_isDirected",!0);ut(this,"_isMultigraph",!1);ut(this,"_isCompound",!1);ut(this,"_label");ut(this,"_defaultNodeLabelFn",()=>{});ut(this,"_defaultEdgeLabelFn",()=>{});ut(this,"_nodes",{});ut(this,"_in",{});ut(this,"_preds",{});ut(this,"_out",{});ut(this,"_sucs",{});ut(this,"_edgeObjs",{});ut(this,"_edgeLabels",{});ut(this,"_nodeCount",0);ut(this,"_edgeCount",0);ut(this,"_parent");ut(this,"_children");p&&(this._isDirected=Object.hasOwn(p,"directed")?p.directed:!0,this._isMultigraph=Object.hasOwn(p,"multigraph")?p.multigraph:!1,this._isCompound=Object.hasOwn(p,"compound")?p.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[t]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(p){return this._label=p,this}graph(){return this._label}setDefaultNodeLabel(p){return this._defaultNodeLabelFn=p,typeof p!="function"&&(this._defaultNodeLabelFn=()=>p),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var p=this;return this.nodes().filter(g=>Object.keys(p._in[g]).length===0)}sinks(){var p=this;return this.nodes().filter(g=>Object.keys(p._out[g]).length===0)}setNodes(p,g){var m=arguments,b=this;return p.forEach(function(x){m.length>1?b.setNode(x,g):b.setNode(x)}),this}setNode(p,g){return Object.hasOwn(this._nodes,p)?(arguments.length>1&&(this._nodes[p]=g),this):(this._nodes[p]=arguments.length>1?g:this._defaultNodeLabelFn(p),this._isCompound&&(this._parent[p]=t,this._children[p]={},this._children[t][p]=!0),this._in[p]={},this._preds[p]={},this._out[p]={},this._sucs[p]={},++this._nodeCount,this)}node(p){return this._nodes[p]}hasNode(p){return Object.hasOwn(this._nodes,p)}removeNode(p){var g=this;if(Object.hasOwn(this._nodes,p)){var m=b=>g.removeEdge(g._edgeObjs[b]);delete this._nodes[p],this._isCompound&&(this._removeFromParentsChildList(p),delete this._parent[p],this.children(p).forEach(function(b){g.setParent(b)}),delete this._children[p]),Object.keys(this._in[p]).forEach(m),delete this._in[p],delete this._preds[p],Object.keys(this._out[p]).forEach(m),delete this._out[p],delete this._sucs[p],--this._nodeCount}return this}setParent(p,g){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(g===void 0)g=t;else{g+="";for(var m=g;m!==void 0;m=this.parent(m))if(m===p)throw new Error("Setting "+g+" as parent of "+p+" would create a cycle");this.setNode(g)}return this.setNode(p),this._removeFromParentsChildList(p),this._parent[p]=g,this._children[g][p]=!0,this}_removeFromParentsChildList(p){delete this._children[this._parent[p]][p]}parent(p){if(this._isCompound){var g=this._parent[p];if(g!==t)return g}}children(p=t){if(this._isCompound){var g=this._children[p];if(g)return Object.keys(g)}else{if(p===t)return this.nodes();if(this.hasNode(p))return[]}}predecessors(p){var g=this._preds[p];if(g)return Object.keys(g)}successors(p){var g=this._sucs[p];if(g)return Object.keys(g)}neighbors(p){var g=this.predecessors(p);if(g){const b=new Set(g);for(var m of this.successors(p))b.add(m);return Array.from(b.values())}}isLeaf(p){var g;return this.isDirected()?g=this.successors(p):g=this.neighbors(p),g.length===0}filterNodes(p){var g=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});g.setGraph(this.graph());var m=this;Object.entries(this._nodes).forEach(function([w,_]){p(w)&&g.setNode(w,_)}),Object.values(this._edgeObjs).forEach(function(w){g.hasNode(w.v)&&g.hasNode(w.w)&&g.setEdge(w,m.edge(w))});var b={};function x(w){var _=m.parent(w);return _===void 0||g.hasNode(_)?(b[w]=_,_):_ in b?b[_]:x(_)}return this._isCompound&&g.nodes().forEach(w=>g.setParent(w,x(w))),g}setDefaultEdgeLabel(p){return this._defaultEdgeLabelFn=p,typeof p!="function"&&(this._defaultEdgeLabelFn=()=>p),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(p,g){var m=this,b=arguments;return p.reduce(function(x,w){return b.length>1?m.setEdge(x,w,g):m.setEdge(x,w),w}),this}setEdge(){var p,g,m,b,x=!1,w=arguments[0];typeof w=="object"&&w!==null&&"v"in w?(p=w.v,g=w.w,m=w.name,arguments.length===2&&(b=arguments[1],x=!0)):(p=w,g=arguments[1],m=arguments[3],arguments.length>2&&(b=arguments[2],x=!0)),p=""+p,g=""+g,m!==void 0&&(m=""+m);var _=o(this._isDirected,p,g,m);if(Object.hasOwn(this._edgeLabels,_))return x&&(this._edgeLabels[_]=b),this;if(m!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(p),this.setNode(g),this._edgeLabels[_]=x?b:this._defaultEdgeLabelFn(p,g,m);var k=c(this._isDirected,p,g,m);return p=k.v,g=k.w,Object.freeze(k),this._edgeObjs[_]=k,s(this._preds[g],p),s(this._sucs[p],g),this._in[g][_]=k,this._out[p][_]=k,this._edgeCount++,this}edge(p,g,m){var b=arguments.length===1?f(this._isDirected,arguments[0]):o(this._isDirected,p,g,m);return this._edgeLabels[b]}edgeAsObj(){const p=this.edge(...arguments);return typeof p!="object"?{label:p}:p}hasEdge(p,g,m){var b=arguments.length===1?f(this._isDirected,arguments[0]):o(this._isDirected,p,g,m);return Object.hasOwn(this._edgeLabels,b)}removeEdge(p,g,m){var b=arguments.length===1?f(this._isDirected,arguments[0]):o(this._isDirected,p,g,m),x=this._edgeObjs[b];return x&&(p=x.v,g=x.w,delete this._edgeLabels[b],delete this._edgeObjs[b],l(this._preds[g],p),l(this._sucs[p],g),delete this._in[g][b],delete this._out[p][b],this._edgeCount--),this}inEdges(p,g){var m=this._in[p];if(m){var b=Object.values(m);return g?b.filter(x=>x.v===g):b}}outEdges(p,g){var m=this._out[p];if(m){var b=Object.values(m);return g?b.filter(x=>x.w===g):b}}nodeEdges(p,g){var m=this.inEdges(p,g);if(m)return m.concat(this.outEdges(p,g))}}function s(d,p){d[p]?d[p]++:d[p]=1}function l(d,p){--d[p]||delete d[p]}function o(d,p,g,m){var b=""+p,x=""+g;if(!d&&b>x){var w=b;b=x,x=w}return b+n+x+n+(m===void 0?e:m)}function c(d,p,g,m){var b=""+p,x=""+g;if(!d&&b>x){var w=b;b=x,x=w}var _={v:b,w:x};return m&&(_.name=m),_}function f(d,p){return o(d,p.v,p.w,p.name)}return wp=r,wp}var _p,Mw;function oF(){return Mw||(Mw=1,_p="2.2.4"),_p}var Sp,Rw;function uF(){return Rw||(Rw=1,Sp={Graph:$m(),version:oF()}),Sp}var kp,Dw;function cF(){if(Dw)return kp;Dw=1;var e=$m();kp={write:t,read:s};function t(l){var o={options:{directed:l.isDirected(),multigraph:l.isMultigraph(),compound:l.isCompound()},nodes:n(l),edges:r(l)};return l.graph()!==void 0&&(o.value=structuredClone(l.graph())),o}function n(l){return l.nodes().map(function(o){var c=l.node(o),f=l.parent(o),d={v:o};return c!==void 0&&(d.value=c),f!==void 0&&(d.parent=f),d})}function r(l){return l.edges().map(function(o){var c=l.edge(o),f={v:o.v,w:o.w};return o.name!==void 0&&(f.name=o.name),c!==void 0&&(f.value=c),f})}function s(l){var o=new e(l.options).setGraph(l.value);return l.nodes.forEach(function(c){o.setNode(c.v,c.value),c.parent&&o.setParent(c.v,c.parent)}),l.edges.forEach(function(c){o.setEdge({v:c.v,w:c.w,name:c.name},c.value)}),o}return kp}var Ep,jw;function fF(){if(jw)return Ep;jw=1,Ep=e;function e(t){var n={},r=[],s;function l(o){Object.hasOwn(n,o)||(n[o]=!0,s.push(o),t.successors(o).forEach(l),t.predecessors(o).forEach(l))}return t.nodes().forEach(function(o){s=[],l(o),s.length&&r.push(s)}),r}return Ep}var Ap,zw;function i2(){if(zw)return Ap;zw=1;class e{constructor(){ut(this,"_arr",[]);ut(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(n){return n.key})}has(n){return Object.hasOwn(this._keyIndices,n)}priority(n){var r=this._keyIndices[n];if(r!==void 0)return this._arr[r].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(n,r){var s=this._keyIndices;if(n=String(n),!Object.hasOwn(s,n)){var l=this._arr,o=l.length;return s[n]=o,l.push({key:n,priority:r}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key}decrease(n,r){var s=this._keyIndices[n];if(r>this._arr[s].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[s].priority+" New: "+r);this._arr[s].priority=r,this._decrease(s)}_heapify(n){var r=this._arr,s=2*n,l=s+1,o=n;s<r.length&&(o=r[s].priority<r[o].priority?s:o,l<r.length&&(o=r[l].priority<r[o].priority?l:o),o!==n&&(this._swap(n,o),this._heapify(o)))}_decrease(n){for(var r=this._arr,s=r[n].priority,l;n!==0&&(l=n>>1,!(r[l].priority<s));)this._swap(n,l),n=l}_swap(n,r){var s=this._arr,l=this._keyIndices,o=s[n],c=s[r];s[n]=c,s[r]=o,l[c.key]=n,l[o.key]=r}}return Ap=e,Ap}var Tp,Lw;function a2(){if(Lw)return Tp;Lw=1;var e=i2();Tp=n;var t=()=>1;function n(s,l,o,c){return r(s,String(l),o||t,c||function(f){return s.outEdges(f)})}function r(s,l,o,c){var f={},d=new e,p,g,m=function(b){var x=b.v!==p?b.v:b.w,w=f[x],_=o(b),k=g.distance+_;if(_<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+b+" Weight: "+_);k<w.distance&&(w.distance=k,w.predecessor=p,d.decrease(x,k))};for(s.nodes().forEach(function(b){var x=b===l?0:Number.POSITIVE_INFINITY;f[b]={distance:x},d.add(b,x)});d.size()>0&&(p=d.removeMin(),g=f[p],g.distance!==Number.POSITIVE_INFINITY);)c(p).forEach(m);return f}return Tp}var Np,Iw;function dF(){if(Iw)return Np;Iw=1;var e=a2();Np=t;function t(n,r,s){return n.nodes().reduce(function(l,o){return l[o]=e(n,o,r,s),l},{})}return Np}var Cp,Bw;function s2(){if(Bw)return Cp;Bw=1,Cp=e;function e(t){var n=0,r=[],s={},l=[];function o(c){var f=s[c]={onStack:!0,lowlink:n,index:n++};if(r.push(c),t.successors(c).forEach(function(g){Object.hasOwn(s,g)?s[g].onStack&&(f.lowlink=Math.min(f.lowlink,s[g].index)):(o(g),f.lowlink=Math.min(f.lowlink,s[g].lowlink))}),f.lowlink===f.index){var d=[],p;do p=r.pop(),s[p].onStack=!1,d.push(p);while(c!==p);l.push(d)}}return t.nodes().forEach(function(c){Object.hasOwn(s,c)||o(c)}),l}return Cp}var Op,Fw;function hF(){if(Fw)return Op;Fw=1;var e=s2();Op=t;function t(n){return e(n).filter(function(r){return r.length>1||r.length===1&&n.hasEdge(r[0],r[0])})}return Op}var Mp,Pw;function pF(){if(Pw)return Mp;Pw=1,Mp=t;var e=()=>1;function t(r,s,l){return n(r,s||e,l||function(o){return r.outEdges(o)})}function n(r,s,l){var o={},c=r.nodes();return c.forEach(function(f){o[f]={},o[f][f]={distance:0},c.forEach(function(d){f!==d&&(o[f][d]={distance:Number.POSITIVE_INFINITY})}),l(f).forEach(function(d){var p=d.v===f?d.w:d.v,g=s(d);o[f][p]={distance:g,predecessor:f}})}),c.forEach(function(f){var d=o[f];c.forEach(function(p){var g=o[p];c.forEach(function(m){var b=g[f],x=d[m],w=g[m],_=b.distance+x.distance;_<w.distance&&(w.distance=_,w.predecessor=x.predecessor)})})}),o}return Mp}var Rp,Uw;function l2(){if(Uw)return Rp;Uw=1;function e(n){var r={},s={},l=[];function o(c){if(Object.hasOwn(s,c))throw new t;Object.hasOwn(r,c)||(s[c]=!0,r[c]=!0,n.predecessors(c).forEach(o),delete s[c],l.push(c))}if(n.sinks().forEach(o),Object.keys(r).length!==n.nodeCount())throw new t;return l}class t extends Error{constructor(){super(...arguments)}}return Rp=e,e.CycleException=t,Rp}var Dp,Hw;function gF(){if(Hw)return Dp;Hw=1;var e=l2();Dp=t;function t(n){try{e(n)}catch(r){if(r instanceof e.CycleException)return!1;throw r}return!0}return Dp}var jp,$w;function o2(){if($w)return jp;$w=1,jp=e;function e(s,l,o){Array.isArray(l)||(l=[l]);var c=s.isDirected()?g=>s.successors(g):g=>s.neighbors(g),f=o==="post"?t:n,d=[],p={};return l.forEach(g=>{if(!s.hasNode(g))throw new Error("Graph does not have node: "+g);f(g,c,p,d)}),d}function t(s,l,o,c){for(var f=[[s,!1]];f.length>0;){var d=f.pop();d[1]?c.push(d[0]):Object.hasOwn(o,d[0])||(o[d[0]]=!0,f.push([d[0],!0]),r(l(d[0]),p=>f.push([p,!1])))}}function n(s,l,o,c){for(var f=[s];f.length>0;){var d=f.pop();Object.hasOwn(o,d)||(o[d]=!0,c.push(d),r(l(d),p=>f.push(p)))}}function r(s,l){for(var o=s.length;o--;)l(s[o],o,s);return s}return jp}var zp,Vw;function mF(){if(Vw)return zp;Vw=1;var e=o2();zp=t;function t(n,r){return e(n,r,"post")}return zp}var Lp,qw;function yF(){if(qw)return Lp;qw=1;var e=o2();Lp=t;function t(n,r){return e(n,r,"pre")}return Lp}var Ip,Gw;function bF(){if(Gw)return Ip;Gw=1;var e=$m(),t=i2();Ip=n;function n(r,s){var l=new e,o={},c=new t,f;function d(g){var m=g.v===f?g.w:g.v,b=c.priority(m);if(b!==void 0){var x=s(g);x<b&&(o[m]=f,c.decrease(m,x))}}if(r.nodeCount()===0)return l;r.nodes().forEach(function(g){c.add(g,Number.POSITIVE_INFINITY),l.setNode(g)}),c.decrease(r.nodes()[0],0);for(var p=!1;c.size()>0;){if(f=c.removeMin(),Object.hasOwn(o,f))l.setEdge(f,o[f]);else{if(p)throw new Error("Input graph is not connected: "+r);p=!0}r.nodeEdges(f).forEach(d)}return l}return Ip}var Bp,Zw;function vF(){return Zw||(Zw=1,Bp={components:fF(),dijkstra:a2(),dijkstraAll:dF(),findCycles:hF(),floydWarshall:pF(),isAcyclic:gF(),postorder:mF(),preorder:yF(),prim:bF(),tarjan:s2(),topsort:l2()}),Bp}var Fp,Yw;function Zn(){if(Yw)return Fp;Yw=1;var e=uF();return Fp={Graph:e.Graph,json:cF(),alg:vF(),version:e.version},Fp}var Pp,Xw;function xF(){if(Xw)return Pp;Xw=1;class e{constructor(){let s={};s._next=s._prev=s,this._sentinel=s}dequeue(){let s=this._sentinel,l=s._prev;if(l!==s)return t(l),l}enqueue(s){let l=this._sentinel;s._prev&&s._next&&t(s),s._next=l._next,l._next._prev=s,l._next=s,s._prev=l}toString(){let s=[],l=this._sentinel,o=l._prev;for(;o!==l;)s.push(JSON.stringify(o,n)),o=o._prev;return"["+s.join(", ")+"]"}}function t(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function n(r,s){if(r!=="_next"&&r!=="_prev")return s}return Pp=e,Pp}var Up,Qw;function wF(){if(Qw)return Up;Qw=1;let e=Zn().Graph,t=xF();Up=r;let n=()=>1;function r(d,p){if(d.nodeCount()<=1)return[];let g=o(d,p||n);return s(g.graph,g.buckets,g.zeroIdx).flatMap(b=>d.outEdges(b.v,b.w))}function s(d,p,g){let m=[],b=p[p.length-1],x=p[0],w;for(;d.nodeCount();){for(;w=x.dequeue();)l(d,p,g,w);for(;w=b.dequeue();)l(d,p,g,w);if(d.nodeCount()){for(let _=p.length-2;_>0;--_)if(w=p[_].dequeue(),w){m=m.concat(l(d,p,g,w,!0));break}}}return m}function l(d,p,g,m,b){let x=b?[]:void 0;return d.inEdges(m.v).forEach(w=>{let _=d.edge(w),k=d.node(w.v);b&&x.push({v:w.v,w:w.w}),k.out-=_,c(p,g,k)}),d.outEdges(m.v).forEach(w=>{let _=d.edge(w),k=w.w,A=d.node(k);A.in-=_,c(p,g,A)}),d.removeNode(m.v),x}function o(d,p){let g=new e,m=0,b=0;d.nodes().forEach(_=>{g.setNode(_,{v:_,in:0,out:0})}),d.edges().forEach(_=>{let k=g.edge(_.v,_.w)||0,A=p(_),S=k+A;g.setEdge(_.v,_.w,S),b=Math.max(b,g.node(_.v).out+=A),m=Math.max(m,g.node(_.w).in+=A)});let x=f(b+m+3).map(()=>new t),w=m+1;return g.nodes().forEach(_=>{c(x,w,g.node(_))}),{graph:g,buckets:x,zeroIdx:w}}function c(d,p,g){g.out?g.in?d[g.out-g.in+p].enqueue(g):d[d.length-1].enqueue(g):d[0].enqueue(g)}function f(d){const p=[];for(let g=0;g<d;g++)p.push(g);return p}return Up}var Hp,Kw;function Tt(){if(Kw)return Hp;Kw=1;let e=Zn().Graph;Hp={addBorderNode:p,addDummyNode:t,applyWithChunking:b,asNonCompoundGraph:r,buildLayerMatrix:c,intersectRect:o,mapValues:M,maxRank:x,normalizeRanks:f,notime:k,partition:w,pick:D,predecessorWeights:l,range:O,removeEmptyRanks:d,simplify:n,successorWeights:s,time:_,uniqueId:S,zipObject:F};function t(L,U,j,H){let B;do B=S(H);while(L.hasNode(B));return j.dummy=U,L.setNode(B,j),B}function n(L){let U=new e().setGraph(L.graph());return L.nodes().forEach(j=>U.setNode(j,L.node(j))),L.edges().forEach(j=>{let H=U.edge(j.v,j.w)||{weight:0,minlen:1},B=L.edge(j);U.setEdge(j.v,j.w,{weight:H.weight+B.weight,minlen:Math.max(H.minlen,B.minlen)})}),U}function r(L){let U=new e({multigraph:L.isMultigraph()}).setGraph(L.graph());return L.nodes().forEach(j=>{L.children(j).length||U.setNode(j,L.node(j))}),L.edges().forEach(j=>{U.setEdge(j,L.edge(j))}),U}function s(L){let U=L.nodes().map(j=>{let H={};return L.outEdges(j).forEach(B=>{H[B.w]=(H[B.w]||0)+L.edge(B).weight}),H});return F(L.nodes(),U)}function l(L){let U=L.nodes().map(j=>{let H={};return L.inEdges(j).forEach(B=>{H[B.v]=(H[B.v]||0)+L.edge(B).weight}),H});return F(L.nodes(),U)}function o(L,U){let j=L.x,H=L.y,B=U.x-j,q=U.y-H,R=L.width/2,$=L.height/2;if(!B&&!q)throw new Error("Not possible to find intersection inside of the rectangle");let I,P;return Math.abs(q)*R>Math.abs(B)*$?(q<0&&($=-$),I=$*B/q,P=$):(B<0&&(R=-R),I=R,P=R*q/B),{x:j+I,y:H+P}}function c(L){let U=O(x(L)+1).map(()=>[]);return L.nodes().forEach(j=>{let H=L.node(j),B=H.rank;B!==void 0&&(U[B][H.order]=j)}),U}function f(L){let U=L.nodes().map(H=>{let B=L.node(H).rank;return B===void 0?Number.MAX_VALUE:B}),j=b(Math.min,U);L.nodes().forEach(H=>{let B=L.node(H);Object.hasOwn(B,"rank")&&(B.rank-=j)})}function d(L){let U=L.nodes().map(R=>L.node(R).rank),j=b(Math.min,U),H=[];L.nodes().forEach(R=>{let $=L.node(R).rank-j;H[$]||(H[$]=[]),H[$].push(R)});let B=0,q=L.graph().nodeRankFactor;Array.from(H).forEach((R,$)=>{R===void 0&&$%q!==0?--B:R!==void 0&&B&&R.forEach(I=>L.node(I).rank+=B)})}function p(L,U,j,H){let B={width:0,height:0};return arguments.length>=4&&(B.rank=j,B.order=H),t(L,"border",B,U)}function g(L,U=m){const j=[];for(let H=0;H<L.length;H+=U){const B=L.slice(H,H+U);j.push(B)}return j}const m=65535;function b(L,U){if(U.length>m){const j=g(U);return L.apply(null,j.map(H=>L.apply(null,H)))}else return L.apply(null,U)}function x(L){const j=L.nodes().map(H=>{let B=L.node(H).rank;return B===void 0?Number.MIN_VALUE:B});return b(Math.max,j)}function w(L,U){let j={lhs:[],rhs:[]};return L.forEach(H=>{U(H)?j.lhs.push(H):j.rhs.push(H)}),j}function _(L,U){let j=Date.now();try{return U()}finally{console.log(L+" time: "+(Date.now()-j)+"ms")}}function k(L,U){return U()}let A=0;function S(L){var U=++A;return toString(L)+U}function O(L,U,j=1){U==null&&(U=L,L=0);let H=q=>q<U;j<0&&(H=q=>U<q);const B=[];for(let q=L;H(q);q+=j)B.push(q);return B}function D(L,U){const j={};for(const H of U)L[H]!==void 0&&(j[H]=L[H]);return j}function M(L,U){let j=U;return typeof U=="string"&&(j=H=>H[U]),Object.entries(L).reduce((H,[B,q])=>(H[B]=j(q,B),H),{})}function F(L,U){return L.reduce((j,H,B)=>(j[H]=U[B],j),{})}return Hp}var $p,Jw;function _F(){if(Jw)return $p;Jw=1;let e=wF(),t=Tt().uniqueId;$p={run:n,undo:s};function n(l){(l.graph().acyclicer==="greedy"?e(l,c(l)):r(l)).forEach(f=>{let d=l.edge(f);l.removeEdge(f),d.forwardName=f.name,d.reversed=!0,l.setEdge(f.w,f.v,d,t("rev"))});function c(f){return d=>f.edge(d).weight}}function r(l){let o=[],c={},f={};function d(p){Object.hasOwn(f,p)||(f[p]=!0,c[p]=!0,l.outEdges(p).forEach(g=>{Object.hasOwn(c,g.w)?o.push(g):d(g.w)}),delete c[p])}return l.nodes().forEach(d),o}function s(l){l.edges().forEach(o=>{let c=l.edge(o);if(c.reversed){l.removeEdge(o);let f=c.forwardName;delete c.reversed,delete c.forwardName,l.setEdge(o.w,o.v,c,f)}})}return $p}var Vp,Ww;function SF(){if(Ww)return Vp;Ww=1;let e=Tt();Vp={run:t,undo:r};function t(s){s.graph().dummyChains=[],s.edges().forEach(l=>n(s,l))}function n(s,l){let o=l.v,c=s.node(o).rank,f=l.w,d=s.node(f).rank,p=l.name,g=s.edge(l),m=g.labelRank;if(d===c+1)return;s.removeEdge(l);let b,x,w;for(w=0,++c;c<d;++w,++c)g.points=[],x={width:0,height:0,edgeLabel:g,edgeObj:l,rank:c},b=e.addDummyNode(s,"edge",x,"_d"),c===m&&(x.width=g.width,x.height=g.height,x.dummy="edge-label",x.labelpos=g.labelpos),s.setEdge(o,b,{weight:g.weight},p),w===0&&s.graph().dummyChains.push(b),o=b;s.setEdge(o,f,{weight:g.weight},p)}function r(s){s.graph().dummyChains.forEach(l=>{let o=s.node(l),c=o.edgeLabel,f;for(s.setEdge(o.edgeObj,c);o.dummy;)f=s.successors(l)[0],s.removeNode(l),c.points.push({x:o.x,y:o.y}),o.dummy==="edge-label"&&(c.x=o.x,c.y=o.y,c.width=o.width,c.height=o.height),l=f,o=s.node(l)})}return Vp}var qp,e_;function Lc(){if(e_)return qp;e_=1;const{applyWithChunking:e}=Tt();qp={longestPath:t,slack:n};function t(r){var s={};function l(o){var c=r.node(o);if(Object.hasOwn(s,o))return c.rank;s[o]=!0;let f=r.outEdges(o).map(p=>p==null?Number.POSITIVE_INFINITY:l(p.w)-r.edge(p).minlen);var d=e(Math.min,f);return d===Number.POSITIVE_INFINITY&&(d=0),c.rank=d}r.sources().forEach(l)}function n(r,s){return r.node(s.w).rank-r.node(s.v).rank-r.edge(s).minlen}return qp}var Gp,t_;function u2(){if(t_)return Gp;t_=1;var e=Zn().Graph,t=Lc().slack;Gp=n;function n(o){var c=new e({directed:!1}),f=o.nodes()[0],d=o.nodeCount();c.setNode(f,{});for(var p,g;r(c,o)<d;)p=s(c,o),g=c.hasNode(p.v)?t(o,p):-t(o,p),l(c,o,g);return c}function r(o,c){function f(d){c.nodeEdges(d).forEach(p=>{var g=p.v,m=d===g?p.w:g;!o.hasNode(m)&&!t(c,p)&&(o.setNode(m,{}),o.setEdge(d,m,{}),f(m))})}return o.nodes().forEach(f),o.nodeCount()}function s(o,c){return c.edges().reduce((d,p)=>{let g=Number.POSITIVE_INFINITY;return o.hasNode(p.v)!==o.hasNode(p.w)&&(g=t(c,p)),g<d[0]?[g,p]:d},[Number.POSITIVE_INFINITY,null])[1]}function l(o,c,f){o.nodes().forEach(d=>c.node(d).rank+=f)}return Gp}var Zp,n_;function kF(){if(n_)return Zp;n_=1;var e=u2(),t=Lc().slack,n=Lc().longestPath,r=Zn().alg.preorder,s=Zn().alg.postorder,l=Tt().simplify;Zp=o,o.initLowLimValues=p,o.initCutValues=c,o.calcCutValue=d,o.leaveEdge=m,o.enterEdge=b,o.exchangeEdges=x;function o(A){A=l(A),n(A);var S=e(A);p(S),c(S,A);for(var O,D;O=m(S);)D=b(S,A,O),x(S,A,O,D)}function c(A,S){var O=s(A,A.nodes());O=O.slice(0,O.length-1),O.forEach(D=>f(A,S,D))}function f(A,S,O){var D=A.node(O),M=D.parent;A.edge(O,M).cutvalue=d(A,S,O)}function d(A,S,O){var D=A.node(O),M=D.parent,F=!0,L=S.edge(O,M),U=0;return L||(F=!1,L=S.edge(M,O)),U=L.weight,S.nodeEdges(O).forEach(j=>{var H=j.v===O,B=H?j.w:j.v;if(B!==M){var q=H===F,R=S.edge(j).weight;if(U+=q?R:-R,_(A,O,B)){var $=A.edge(O,B).cutvalue;U+=q?-$:$}}}),U}function p(A,S){arguments.length<2&&(S=A.nodes()[0]),g(A,{},1,S)}function g(A,S,O,D,M){var F=O,L=A.node(D);return S[D]=!0,A.neighbors(D).forEach(U=>{Object.hasOwn(S,U)||(O=g(A,S,O,U,D))}),L.low=F,L.lim=O++,M?L.parent=M:delete L.parent,O}function m(A){return A.edges().find(S=>A.edge(S).cutvalue<0)}function b(A,S,O){var D=O.v,M=O.w;S.hasEdge(D,M)||(D=O.w,M=O.v);var F=A.node(D),L=A.node(M),U=F,j=!1;F.lim>L.lim&&(U=L,j=!0);var H=S.edges().filter(B=>j===k(A,A.node(B.v),U)&&j!==k(A,A.node(B.w),U));return H.reduce((B,q)=>t(S,q)<t(S,B)?q:B)}function x(A,S,O,D){var M=O.v,F=O.w;A.removeEdge(M,F),A.setEdge(D.v,D.w,{}),p(A),c(A,S),w(A,S)}function w(A,S){var O=A.nodes().find(M=>!S.node(M).parent),D=r(A,O);D=D.slice(1),D.forEach(M=>{var F=A.node(M).parent,L=S.edge(M,F),U=!1;L||(L=S.edge(F,M),U=!0),S.node(M).rank=S.node(F).rank+(U?L.minlen:-L.minlen)})}function _(A,S,O){return A.hasEdge(S,O)}function k(A,S,O){return O.low<=S.lim&&S.lim<=O.lim}return Zp}var Yp,r_;function EF(){if(r_)return Yp;r_=1;var e=Lc(),t=e.longestPath,n=u2(),r=kF();Yp=s;function s(f){switch(f.graph().ranker){case"network-simplex":c(f);break;case"tight-tree":o(f);break;case"longest-path":l(f);break;default:c(f)}}var l=t;function o(f){t(f),n(f)}function c(f){r(f)}return Yp}var Xp,i_;function AF(){if(i_)return Xp;i_=1,Xp=e;function e(r){let s=n(r);r.graph().dummyChains.forEach(l=>{let o=r.node(l),c=o.edgeObj,f=t(r,s,c.v,c.w),d=f.path,p=f.lca,g=0,m=d[g],b=!0;for(;l!==c.w;){if(o=r.node(l),b){for(;(m=d[g])!==p&&r.node(m).maxRank<o.rank;)g++;m===p&&(b=!1)}if(!b){for(;g<d.length-1&&r.node(m=d[g+1]).minRank<=o.rank;)g++;m=d[g]}r.setParent(l,m),l=r.successors(l)[0]}})}function t(r,s,l,o){let c=[],f=[],d=Math.min(s[l].low,s[o].low),p=Math.max(s[l].lim,s[o].lim),g,m;g=l;do g=r.parent(g),c.push(g);while(g&&(s[g].low>d||p>s[g].lim));for(m=g,g=o;(g=r.parent(g))!==m;)f.push(g);return{path:c.concat(f.reverse()),lca:m}}function n(r){let s={},l=0;function o(c){let f=l;r.children(c).forEach(o),s[c]={low:f,lim:l++}}return r.children().forEach(o),s}return Xp}var Qp,a_;function TF(){if(a_)return Qp;a_=1;let e=Tt();Qp={run:t,cleanup:l};function t(o){let c=e.addDummyNode(o,"root",{},"_root"),f=r(o),d=Object.values(f),p=e.applyWithChunking(Math.max,d)-1,g=2*p+1;o.graph().nestingRoot=c,o.edges().forEach(b=>o.edge(b).minlen*=g);let m=s(o)+1;o.children().forEach(b=>n(o,c,g,m,p,f,b)),o.graph().nodeRankFactor=g}function n(o,c,f,d,p,g,m){let b=o.children(m);if(!b.length){m!==c&&o.setEdge(c,m,{weight:0,minlen:f});return}let x=e.addBorderNode(o,"_bt"),w=e.addBorderNode(o,"_bb"),_=o.node(m);o.setParent(x,m),_.borderTop=x,o.setParent(w,m),_.borderBottom=w,b.forEach(k=>{n(o,c,f,d,p,g,k);let A=o.node(k),S=A.borderTop?A.borderTop:k,O=A.borderBottom?A.borderBottom:k,D=A.borderTop?d:2*d,M=S!==O?1:p-g[m]+1;o.setEdge(x,S,{weight:D,minlen:M,nestingEdge:!0}),o.setEdge(O,w,{weight:D,minlen:M,nestingEdge:!0})}),o.parent(m)||o.setEdge(c,x,{weight:0,minlen:p+g[m]})}function r(o){var c={};function f(d,p){var g=o.children(d);g&&g.length&&g.forEach(m=>f(m,p+1)),c[d]=p}return o.children().forEach(d=>f(d,1)),c}function s(o){return o.edges().reduce((c,f)=>c+o.edge(f).weight,0)}function l(o){var c=o.graph();o.removeNode(c.nestingRoot),delete c.nestingRoot,o.edges().forEach(f=>{var d=o.edge(f);d.nestingEdge&&o.removeEdge(f)})}return Qp}var Kp,s_;function NF(){if(s_)return Kp;s_=1;let e=Tt();Kp=t;function t(r){function s(l){let o=r.children(l),c=r.node(l);if(o.length&&o.forEach(s),Object.hasOwn(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(let f=c.minRank,d=c.maxRank+1;f<d;++f)n(r,"borderLeft","_bl",l,c,f),n(r,"borderRight","_br",l,c,f)}}r.children().forEach(s)}function n(r,s,l,o,c,f){let d={width:0,height:0,rank:f,borderType:s},p=c[s][f-1],g=e.addDummyNode(r,"border",d,l);c[s][f]=g,r.setParent(g,o),p&&r.setEdge(p,g,{weight:1})}return Kp}var Jp,l_;function CF(){if(l_)return Jp;l_=1,Jp={adjust:e,undo:t};function e(f){let d=f.graph().rankdir.toLowerCase();(d==="lr"||d==="rl")&&n(f)}function t(f){let d=f.graph().rankdir.toLowerCase();(d==="bt"||d==="rl")&&s(f),(d==="lr"||d==="rl")&&(o(f),n(f))}function n(f){f.nodes().forEach(d=>r(f.node(d))),f.edges().forEach(d=>r(f.edge(d)))}function r(f){let d=f.width;f.width=f.height,f.height=d}function s(f){f.nodes().forEach(d=>l(f.node(d))),f.edges().forEach(d=>{let p=f.edge(d);p.points.forEach(l),Object.hasOwn(p,"y")&&l(p)})}function l(f){f.y=-f.y}function o(f){f.nodes().forEach(d=>c(f.node(d))),f.edges().forEach(d=>{let p=f.edge(d);p.points.forEach(c),Object.hasOwn(p,"x")&&c(p)})}function c(f){let d=f.x;f.x=f.y,f.y=d}return Jp}var Wp,o_;function OF(){if(o_)return Wp;o_=1;let e=Tt();Wp=t;function t(n){let r={},s=n.nodes().filter(p=>!n.children(p).length),l=s.map(p=>n.node(p).rank),o=e.applyWithChunking(Math.max,l),c=e.range(o+1).map(()=>[]);function f(p){if(r[p])return;r[p]=!0;let g=n.node(p);c[g.rank].push(p),n.successors(p).forEach(f)}return s.sort((p,g)=>n.node(p).rank-n.node(g).rank).forEach(f),c}return Wp}var eg,u_;function MF(){if(u_)return eg;u_=1;let e=Tt().zipObject;eg=t;function t(r,s){let l=0;for(let o=1;o<s.length;++o)l+=n(r,s[o-1],s[o]);return l}function n(r,s,l){let o=e(l,l.map((m,b)=>b)),c=s.flatMap(m=>r.outEdges(m).map(b=>({pos:o[b.w],weight:r.edge(b).weight})).sort((b,x)=>b.pos-x.pos)),f=1;for(;f<l.length;)f<<=1;let d=2*f-1;f-=1;let p=new Array(d).fill(0),g=0;return c.forEach(m=>{let b=m.pos+f;p[b]+=m.weight;let x=0;for(;b>0;)b%2&&(x+=p[b+1]),b=b-1>>1,p[b]+=m.weight;g+=m.weight*x}),g}return eg}var tg,c_;function RF(){if(c_)return tg;c_=1,tg=e;function e(t,n=[]){return n.map(r=>{let s=t.inEdges(r);if(s.length){let l=s.reduce((o,c)=>{let f=t.edge(c),d=t.node(c.v);return{sum:o.sum+f.weight*d.order,weight:o.weight+f.weight}},{sum:0,weight:0});return{v:r,barycenter:l.sum/l.weight,weight:l.weight}}else return{v:r}})}return tg}var ng,f_;function DF(){if(f_)return ng;f_=1;let e=Tt();ng=t;function t(s,l){let o={};s.forEach((f,d)=>{let p=o[f.v]={indegree:0,in:[],out:[],vs:[f.v],i:d};f.barycenter!==void 0&&(p.barycenter=f.barycenter,p.weight=f.weight)}),l.edges().forEach(f=>{let d=o[f.v],p=o[f.w];d!==void 0&&p!==void 0&&(p.indegree++,d.out.push(o[f.w]))});let c=Object.values(o).filter(f=>!f.indegree);return n(c)}function n(s){let l=[];function o(f){return d=>{d.merged||(d.barycenter===void 0||f.barycenter===void 0||d.barycenter>=f.barycenter)&&r(f,d)}}function c(f){return d=>{d.in.push(f),--d.indegree===0&&s.push(d)}}for(;s.length;){let f=s.pop();l.push(f),f.in.reverse().forEach(o(f)),f.out.forEach(c(f))}return l.filter(f=>!f.merged).map(f=>e.pick(f,["vs","i","barycenter","weight"]))}function r(s,l){let o=0,c=0;s.weight&&(o+=s.barycenter*s.weight,c+=s.weight),l.weight&&(o+=l.barycenter*l.weight,c+=l.weight),s.vs=l.vs.concat(s.vs),s.barycenter=o/c,s.weight=c,s.i=Math.min(l.i,s.i),l.merged=!0}return ng}var rg,d_;function jF(){if(d_)return rg;d_=1;let e=Tt();rg=t;function t(s,l){let o=e.partition(s,x=>Object.hasOwn(x,"barycenter")),c=o.lhs,f=o.rhs.sort((x,w)=>w.i-x.i),d=[],p=0,g=0,m=0;c.sort(r(!!l)),m=n(d,f,m),c.forEach(x=>{m+=x.vs.length,d.push(x.vs),p+=x.barycenter*x.weight,g+=x.weight,m=n(d,f,m)});let b={vs:d.flat(!0)};return g&&(b.barycenter=p/g,b.weight=g),b}function n(s,l,o){let c;for(;l.length&&(c=l[l.length-1]).i<=o;)l.pop(),s.push(c.vs),o++;return o}function r(s){return(l,o)=>l.barycenter<o.barycenter?-1:l.barycenter>o.barycenter?1:s?o.i-l.i:l.i-o.i}return rg}var ig,h_;function zF(){if(h_)return ig;h_=1;let e=RF(),t=DF(),n=jF();ig=r;function r(o,c,f,d){let p=o.children(c),g=o.node(c),m=g?g.borderLeft:void 0,b=g?g.borderRight:void 0,x={};m&&(p=p.filter(A=>A!==m&&A!==b));let w=e(o,p);w.forEach(A=>{if(o.children(A.v).length){let S=r(o,A.v,f,d);x[A.v]=S,Object.hasOwn(S,"barycenter")&&l(A,S)}});let _=t(w,f);s(_,x);let k=n(_,d);if(m&&(k.vs=[m,k.vs,b].flat(!0),o.predecessors(m).length)){let A=o.node(o.predecessors(m)[0]),S=o.node(o.predecessors(b)[0]);Object.hasOwn(k,"barycenter")||(k.barycenter=0,k.weight=0),k.barycenter=(k.barycenter*k.weight+A.order+S.order)/(k.weight+2),k.weight+=2}return k}function s(o,c){o.forEach(f=>{f.vs=f.vs.flatMap(d=>c[d]?c[d].vs:d)})}function l(o,c){o.barycenter!==void 0?(o.barycenter=(o.barycenter*o.weight+c.barycenter*c.weight)/(o.weight+c.weight),o.weight+=c.weight):(o.barycenter=c.barycenter,o.weight=c.weight)}return ig}var ag,p_;function LF(){if(p_)return ag;p_=1;let e=Zn().Graph,t=Tt();ag=n;function n(s,l,o){let c=r(s),f=new e({compound:!0}).setGraph({root:c}).setDefaultNodeLabel(d=>s.node(d));return s.nodes().forEach(d=>{let p=s.node(d),g=s.parent(d);(p.rank===l||p.minRank<=l&&l<=p.maxRank)&&(f.setNode(d),f.setParent(d,g||c),s[o](d).forEach(m=>{let b=m.v===d?m.w:m.v,x=f.edge(b,d),w=x!==void 0?x.weight:0;f.setEdge(b,d,{weight:s.edge(m).weight+w})}),Object.hasOwn(p,"minRank")&&f.setNode(d,{borderLeft:p.borderLeft[l],borderRight:p.borderRight[l]}))}),f}function r(s){for(var l;s.hasNode(l=t.uniqueId("_root")););return l}return ag}var sg,g_;function IF(){if(g_)return sg;g_=1,sg=e;function e(t,n,r){let s={},l;r.forEach(o=>{let c=t.parent(o),f,d;for(;c;){if(f=t.parent(c),f?(d=s[f],s[f]=c):(d=l,l=c),d&&d!==c){n.setEdge(d,c);return}c=f}})}return sg}var lg,m_;function BF(){if(m_)return lg;m_=1;let e=OF(),t=MF(),n=zF(),r=LF(),s=IF(),l=Zn().Graph,o=Tt();lg=c;function c(g,m){if(m&&typeof m.customOrder=="function"){m.customOrder(g,c);return}let b=o.maxRank(g),x=f(g,o.range(1,b+1),"inEdges"),w=f(g,o.range(b-1,-1,-1),"outEdges"),_=e(g);if(p(g,_),m&&m.disableOptimalOrderHeuristic)return;let k=Number.POSITIVE_INFINITY,A;for(let S=0,O=0;O<4;++S,++O){d(S%2?x:w,S%4>=2),_=o.buildLayerMatrix(g);let D=t(g,_);D<k&&(O=0,A=Object.assign({},_),k=D)}p(g,A)}function f(g,m,b){return m.map(function(x){return r(g,x,b)})}function d(g,m){let b=new l;g.forEach(function(x){let w=x.graph().root,_=n(x,w,b,m);_.vs.forEach((k,A)=>x.node(k).order=A),s(x,b,_.vs)})}function p(g,m){Object.values(m).forEach(b=>b.forEach((x,w)=>g.node(x).order=w))}return lg}var og,y_;function FF(){if(y_)return og;y_=1;let e=Zn().Graph,t=Tt();og={positionX:b,findType1Conflicts:n,findType2Conflicts:r,addConflict:l,hasConflict:o,verticalAlignment:c,horizontalCompaction:f,alignCoordinates:g,findSmallestWidthAlignment:p,balance:m};function n(_,k){let A={};function S(O,D){let M=0,F=0,L=O.length,U=D[D.length-1];return D.forEach((j,H)=>{let B=s(_,j),q=B?_.node(B).order:L;(B||j===U)&&(D.slice(F,H+1).forEach(R=>{_.predecessors(R).forEach($=>{let I=_.node($),P=I.order;(P<M||q<P)&&!(I.dummy&&_.node(R).dummy)&&l(A,$,R)})}),F=H+1,M=q)}),D}return k.length&&k.reduce(S),A}function r(_,k){let A={};function S(D,M,F,L,U){let j;t.range(M,F).forEach(H=>{j=D[H],_.node(j).dummy&&_.predecessors(j).forEach(B=>{let q=_.node(B);q.dummy&&(q.order<L||q.order>U)&&l(A,B,j)})})}function O(D,M){let F=-1,L,U=0;return M.forEach((j,H)=>{if(_.node(j).dummy==="border"){let B=_.predecessors(j);B.length&&(L=_.node(B[0]).order,S(M,U,H,F,L),U=H,F=L)}S(M,U,M.length,L,D.length)}),M}return k.length&&k.reduce(O),A}function s(_,k){if(_.node(k).dummy)return _.predecessors(k).find(A=>_.node(A).dummy)}function l(_,k,A){if(k>A){let O=k;k=A,A=O}let S=_[k];S||(_[k]=S={}),S[A]=!0}function o(_,k,A){if(k>A){let S=k;k=A,A=S}return!!_[k]&&Object.hasOwn(_[k],A)}function c(_,k,A,S){let O={},D={},M={};return k.forEach(F=>{F.forEach((L,U)=>{O[L]=L,D[L]=L,M[L]=U})}),k.forEach(F=>{let L=-1;F.forEach(U=>{let j=S(U);if(j.length){j=j.sort((B,q)=>M[B]-M[q]);let H=(j.length-1)/2;for(let B=Math.floor(H),q=Math.ceil(H);B<=q;++B){let R=j[B];D[U]===U&&L<M[R]&&!o(A,U,R)&&(D[R]=U,D[U]=O[U]=O[R],L=M[R])}}})}),{root:O,align:D}}function f(_,k,A,S,O){let D={},M=d(_,k,A,O),F=O?"borderLeft":"borderRight";function L(H,B){let q=M.nodes(),R=q.pop(),$={};for(;R;)$[R]?H(R):($[R]=!0,q.push(R),q=q.concat(B(R))),R=q.pop()}function U(H){D[H]=M.inEdges(H).reduce((B,q)=>Math.max(B,D[q.v]+M.edge(q)),0)}function j(H){let B=M.outEdges(H).reduce((R,$)=>Math.min(R,D[$.w]-M.edge($)),Number.POSITIVE_INFINITY),q=_.node(H);B!==Number.POSITIVE_INFINITY&&q.borderType!==F&&(D[H]=Math.max(D[H],B))}return L(U,M.predecessors.bind(M)),L(j,M.successors.bind(M)),Object.keys(S).forEach(H=>D[H]=D[A[H]]),D}function d(_,k,A,S){let O=new e,D=_.graph(),M=x(D.nodesep,D.edgesep,S);return k.forEach(F=>{let L;F.forEach(U=>{let j=A[U];if(O.setNode(j),L){var H=A[L],B=O.edge(H,j);O.setEdge(H,j,Math.max(M(_,U,L),B||0))}L=U})}),O}function p(_,k){return Object.values(k).reduce((A,S)=>{let O=Number.NEGATIVE_INFINITY,D=Number.POSITIVE_INFINITY;Object.entries(S).forEach(([F,L])=>{let U=w(_,F)/2;O=Math.max(L+U,O),D=Math.min(L-U,D)});const M=O-D;return M<A[0]&&(A=[M,S]),A},[Number.POSITIVE_INFINITY,null])[1]}function g(_,k){let A=Object.values(k),S=t.applyWithChunking(Math.min,A),O=t.applyWithChunking(Math.max,A);["u","d"].forEach(D=>{["l","r"].forEach(M=>{let F=D+M,L=_[F];if(L===k)return;let U=Object.values(L),j=S-t.applyWithChunking(Math.min,U);M!=="l"&&(j=O-t.applyWithChunking(Math.max,U)),j&&(_[F]=t.mapValues(L,H=>H+j))})})}function m(_,k){return t.mapValues(_.ul,(A,S)=>{if(k)return _[k.toLowerCase()][S];{let O=Object.values(_).map(D=>D[S]).sort((D,M)=>D-M);return(O[1]+O[2])/2}})}function b(_){let k=t.buildLayerMatrix(_),A=Object.assign(n(_,k),r(_,k)),S={},O;["u","d"].forEach(M=>{O=M==="u"?k:Object.values(k).reverse(),["l","r"].forEach(F=>{F==="r"&&(O=O.map(H=>Object.values(H).reverse()));let L=(M==="u"?_.predecessors:_.successors).bind(_),U=c(_,O,A,L),j=f(_,O,U.root,U.align,F==="r");F==="r"&&(j=t.mapValues(j,H=>-H)),S[M+F]=j})});let D=p(_,S);return g(S,D),m(S,_.graph().align)}function x(_,k,A){return(S,O,D)=>{let M=S.node(O),F=S.node(D),L=0,U;if(L+=M.width/2,Object.hasOwn(M,"labelpos"))switch(M.labelpos.toLowerCase()){case"l":U=-M.width/2;break;case"r":U=M.width/2;break}if(U&&(L+=A?U:-U),U=0,L+=(M.dummy?k:_)/2,L+=(F.dummy?k:_)/2,L+=F.width/2,Object.hasOwn(F,"labelpos"))switch(F.labelpos.toLowerCase()){case"l":U=F.width/2;break;case"r":U=-F.width/2;break}return U&&(L+=A?U:-U),U=0,L}}function w(_,k){return _.node(k).width}return og}var ug,b_;function PF(){if(b_)return ug;b_=1;let e=Tt(),t=FF().positionX;ug=n;function n(s){s=e.asNonCompoundGraph(s),r(s),Object.entries(t(s)).forEach(([l,o])=>s.node(l).x=o)}function r(s){let l=e.buildLayerMatrix(s),o=s.graph().ranksep,c=0;l.forEach(f=>{const d=f.reduce((p,g)=>{const m=s.node(g).height;return p>m?p:m},0);f.forEach(p=>s.node(p).y=c+d/2),c+=d+o})}return ug}var cg,v_;function UF(){if(v_)return cg;v_=1;let e=_F(),t=SF(),n=EF(),r=Tt().normalizeRanks,s=AF(),l=Tt().removeEmptyRanks,o=TF(),c=NF(),f=CF(),d=BF(),p=PF(),g=Tt(),m=Zn().Graph;cg=b;function b(T,V){let K=V&&V.debugTiming?g.time:g.notime;K("layout",()=>{let J=K(" buildLayoutGraph",()=>L(T));K(" runLayout",()=>x(J,K,V)),K(" updateInputGraph",()=>w(T,J))})}function x(T,V,K){V(" makeSpaceForEdgeLabels",()=>U(T)),V(" removeSelfEdges",()=>Y(T)),V(" acyclic",()=>e.run(T)),V(" nestingGraph.run",()=>o.run(T)),V(" rank",()=>n(g.asNonCompoundGraph(T))),V(" injectEdgeLabelProxies",()=>j(T)),V(" removeEmptyRanks",()=>l(T)),V(" nestingGraph.cleanup",()=>o.cleanup(T)),V(" normalizeRanks",()=>r(T)),V(" assignRankMinMax",()=>H(T)),V(" removeEdgeLabelProxies",()=>B(T)),V(" normalize.run",()=>t.run(T)),V(" parentDummyChains",()=>s(T)),V(" addBorderSegments",()=>c(T)),V(" order",()=>d(T,K)),V(" insertSelfEdges",()=>X(T)),V(" adjustCoordinateSystem",()=>f.adjust(T)),V(" position",()=>p(T)),V(" positionSelfEdges",()=>E(T)),V(" removeBorderNodes",()=>P(T)),V(" normalize.undo",()=>t.undo(T)),V(" fixupEdgeLabelCoords",()=>$(T)),V(" undoCoordinateSystem",()=>f.undo(T)),V(" translateGraph",()=>q(T)),V(" assignNodeIntersects",()=>R(T)),V(" reversePoints",()=>I(T)),V(" acyclic.undo",()=>e.undo(T))}function w(T,V){T.nodes().forEach(K=>{let J=T.node(K),le=V.node(K);J&&(J.x=le.x,J.y=le.y,J.rank=le.rank,V.children(K).length&&(J.width=le.width,J.height=le.height))}),T.edges().forEach(K=>{let J=T.edge(K),le=V.edge(K);J.points=le.points,Object.hasOwn(le,"x")&&(J.x=le.x,J.y=le.y)}),T.graph().width=V.graph().width,T.graph().height=V.graph().height}let _=["nodesep","edgesep","ranksep","marginx","marginy"],k={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},A=["acyclicer","ranker","rankdir","align"],S=["width","height"],O={width:0,height:0},D=["minlen","weight","width","height","labeloffset"],M={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},F=["labelpos"];function L(T){let V=new m({multigraph:!0,compound:!0}),K=te(T.graph());return V.setGraph(Object.assign({},k,G(K,_),g.pick(K,A))),T.nodes().forEach(J=>{let le=te(T.node(J));const fe=G(le,S);Object.keys(O).forEach(ye=>{fe[ye]===void 0&&(fe[ye]=O[ye])}),V.setNode(J,fe),V.setParent(J,T.parent(J))}),T.edges().forEach(J=>{let le=te(T.edge(J));V.setEdge(J,Object.assign({},M,G(le,D),g.pick(le,F)))}),V}function U(T){let V=T.graph();V.ranksep/=2,T.edges().forEach(K=>{let J=T.edge(K);J.minlen*=2,J.labelpos.toLowerCase()!=="c"&&(V.rankdir==="TB"||V.rankdir==="BT"?J.width+=J.labeloffset:J.height+=J.labeloffset)})}function j(T){T.edges().forEach(V=>{let K=T.edge(V);if(K.width&&K.height){let J=T.node(V.v),fe={rank:(T.node(V.w).rank-J.rank)/2+J.rank,e:V};g.addDummyNode(T,"edge-proxy",fe,"_ep")}})}function H(T){let V=0;T.nodes().forEach(K=>{let J=T.node(K);J.borderTop&&(J.minRank=T.node(J.borderTop).rank,J.maxRank=T.node(J.borderBottom).rank,V=Math.max(V,J.maxRank))}),T.graph().maxRank=V}function B(T){T.nodes().forEach(V=>{let K=T.node(V);K.dummy==="edge-proxy"&&(T.edge(K.e).labelRank=K.rank,T.removeNode(V))})}function q(T){let V=Number.POSITIVE_INFINITY,K=0,J=Number.POSITIVE_INFINITY,le=0,fe=T.graph(),ye=fe.marginx||0,Ae=fe.marginy||0;function Se(be){let je=be.x,ze=be.y,lt=be.width,ft=be.height;V=Math.min(V,je-lt/2),K=Math.max(K,je+lt/2),J=Math.min(J,ze-ft/2),le=Math.max(le,ze+ft/2)}T.nodes().forEach(be=>Se(T.node(be))),T.edges().forEach(be=>{let je=T.edge(be);Object.hasOwn(je,"x")&&Se(je)}),V-=ye,J-=Ae,T.nodes().forEach(be=>{let je=T.node(be);je.x-=V,je.y-=J}),T.edges().forEach(be=>{let je=T.edge(be);je.points.forEach(ze=>{ze.x-=V,ze.y-=J}),Object.hasOwn(je,"x")&&(je.x-=V),Object.hasOwn(je,"y")&&(je.y-=J)}),fe.width=K-V+ye,fe.height=le-J+Ae}function R(T){T.edges().forEach(V=>{let K=T.edge(V),J=T.node(V.v),le=T.node(V.w),fe,ye;K.points?(fe=K.points[0],ye=K.points[K.points.length-1]):(K.points=[],fe=le,ye=J),K.points.unshift(g.intersectRect(J,fe)),K.points.push(g.intersectRect(le,ye))})}function $(T){T.edges().forEach(V=>{let K=T.edge(V);if(Object.hasOwn(K,"x"))switch((K.labelpos==="l"||K.labelpos==="r")&&(K.width-=K.labeloffset),K.labelpos){case"l":K.x-=K.width/2+K.labeloffset;break;case"r":K.x+=K.width/2+K.labeloffset;break}})}function I(T){T.edges().forEach(V=>{let K=T.edge(V);K.reversed&&K.points.reverse()})}function P(T){T.nodes().forEach(V=>{if(T.children(V).length){let K=T.node(V),J=T.node(K.borderTop),le=T.node(K.borderBottom),fe=T.node(K.borderLeft[K.borderLeft.length-1]),ye=T.node(K.borderRight[K.borderRight.length-1]);K.width=Math.abs(ye.x-fe.x),K.height=Math.abs(le.y-J.y),K.x=fe.x+K.width/2,K.y=J.y+K.height/2}}),T.nodes().forEach(V=>{T.node(V).dummy==="border"&&T.removeNode(V)})}function Y(T){T.edges().forEach(V=>{if(V.v===V.w){var K=T.node(V.v);K.selfEdges||(K.selfEdges=[]),K.selfEdges.push({e:V,label:T.edge(V)}),T.removeEdge(V)}})}function X(T){var V=g.buildLayerMatrix(T);V.forEach(K=>{var J=0;K.forEach((le,fe)=>{var ye=T.node(le);ye.order=fe+J,(ye.selfEdges||[]).forEach(Ae=>{g.addDummyNode(T,"selfedge",{width:Ae.label.width,height:Ae.label.height,rank:ye.rank,order:fe+ ++J,e:Ae.e,label:Ae.label},"_se")}),delete ye.selfEdges})})}function E(T){T.nodes().forEach(V=>{var K=T.node(V);if(K.dummy==="selfedge"){var J=T.node(K.e.v),le=J.x+J.width/2,fe=J.y,ye=K.x-le,Ae=J.height/2;T.setEdge(K.e,K.label),T.removeNode(V),K.label.points=[{x:le+2*ye/3,y:fe-Ae},{x:le+5*ye/6,y:fe-Ae},{x:le+ye,y:fe},{x:le+5*ye/6,y:fe+Ae},{x:le+2*ye/3,y:fe+Ae}],K.label.x=K.x,K.label.y=K.y}})}function G(T,V){return g.mapValues(g.pick(T,V),Number)}function te(T){var V={};return T&&Object.entries(T).forEach(([K,J])=>{typeof K=="string"&&(K=K.toLowerCase()),V[K]=J}),V}return cg}var fg,x_;function HF(){if(x_)return fg;x_=1;let e=Tt(),t=Zn().Graph;fg={debugOrdering:n};function n(r){let s=e.buildLayerMatrix(r),l=new t({compound:!0,multigraph:!0}).setGraph({});return r.nodes().forEach(o=>{l.setNode(o,{label:o}),l.setParent(o,"layer"+r.node(o).rank)}),r.edges().forEach(o=>l.setEdge(o.v,o.w,{},o.name)),s.forEach((o,c)=>{let f="layer"+c;l.setNode(f,{rank:"same"}),o.reduce((d,p)=>(l.setEdge(d,p,{style:"invis"}),p))}),l}return fg}var dg,w_;function $F(){return w_||(w_=1,dg="1.1.4"),dg}var hg,__;function VF(){return __||(__=1,hg={graphlib:Zn(),layout:UF(),debug:HF(),util:{time:Tt().time,notime:Tt().notime},version:$F()}),hg}var qF=VF();const S_=ki(qF);function GF(e){const t=new Map,n=[],r=l=>{const o=l.id.split(":"),c=o.slice(0,-1).join(":");if(o.length!==1){if(!t.has(c)){const f={id:c,type:"group",data:{label:c.split(":").pop(),name:c.split(":").pop()},position:{x:0,y:0},style:{},parentId:void 0},d=r(f);d&&(f.parentId=d.id),t.set(c,f)}return t.get(c)}};return e.forEach(l=>{const o={...l,id:l.id.toString(),position:{x:0,y:0},data:{label:l.id.split(":").pop(),name:l.id.split(":").pop()}},c=r(o);c&&(o.parentId=c.id.toString()),n.push(o)}),[...Array.from(t.values()),...n]}const ZF={group:({data:e})=>N.jsx("div",{className:"absolute bottom-full left-0",children:N.jsx("span",{children:e.name})})},YF=(e,t)=>{const n=e.map(r=>{const s=t.find(f=>f.id===r.source.toString()),l=t.find(f=>f.id===r.target.toString()),o=s==null?void 0:s.id,c=l==null?void 0:l.id;return{id:`${o}=${c}`,source:o,target:c,animated:r.conditional,label:r.data,style:{stroke:r.conditional?"#2563eb":"#64748b"}}});if(!n.find(r=>r.target==="__end__")){const r=[...t].reverse().find(s=>s.id.endsWith(":__end__"));r&&n.push({id:`${r.id}=__end__`,source:r.id,target:"__end__",type:"smoothstep"})}return n},XF=()=>{const{fitView:e}=sf(),{graphVisualize:t,currentNodeName:n}=oa(),r=t||{nodes:[],edges:[]},s=GF(r.nodes.map(b=>({...b,type:"default"}))),l=YF(r.edges,s),[o,c,f]=z7(s),[d,p,g]=L7(l),m=W.useCallback(b=>{const x=k_(o,d,{direction:b});c([...x.nodes]),p([...x.edges]),e()},[o,d]);return W.useEffect(()=>{if(r.nodes.length>0){const b=k_(s,l,{direction:"TB"});c([...b.nodes]),p([...b.edges]),e()}},[r]),W.useEffect(()=>{const b=o.findIndex(x=>x.id.endsWith(n));if(b!==-1){const x=[...o].map(w=>({...w,selected:!1}));x[b]={...x[b],selected:!0},c(x),e()}},[n]),N.jsx("div",{className:"w-1/3 h-full relative overflow-hidden border-l",children:N.jsxs(j7,{nodes:o,edges:d,onNodesChange:f,onEdgesChange:g,fitView:!0,className:"w-full h-full",nodeTypes:ZF,children:[N.jsx(U7,{}),N.jsx(Y7,{}),N.jsxs(mo,{position:"top-right",className:"flex gap-2",children:[N.jsx("button",{onClick:()=>m("TB"),className:"px-3 py-1.5 bg-white border border-gray-200 rounded-lg text-sm text-gray-700 hover:bg-gray-50 transition-colors",children:"垂直布局"}),N.jsx("button",{onClick:()=>m("LR"),className:"px-3 py-1.5 bg-white border border-gray-200 rounded-lg text-sm text-gray-700 hover:bg-gray-50 transition-colors",children:"水平布局"})]})]})})},k_=(e,t,n)=>{const r=new S_.graphlib.Graph({compound:!0,multigraph:!0}).setDefaultEdgeLabel(()=>({}));r.setGraph({rankdir:n.direction,nodesep:40,ranksep:40,edgesep:20}),e.forEach(c=>{c.type!=="group"&&r.setNode(c.id,{...c,width:128,height:20})}),t.forEach(c=>r.setEdge(c.source,c.target)),S_.layout(r);const s=e.map(c=>{const f=r.node(c.id);if(!f)return{...c};let d=0,p=0;return d=f.x+((f==null?void 0:f.width)??0),p=f.y+((f==null?void 0:f.height)??0),{...c,position:{x:d,y:p},_p:f,width:f.width,height:f.height}}),l=new Map,o=15;return[...s].reverse().forEach(c=>{if(c.type==="group"){const f=l.get(c.id)||[],d=Math.min(...f.map(b=>b.position.x)),p=Math.min(...f.map(b=>b.position.y)),g=Math.max(...f.map(b=>b.position.x+(b.width??0))),m=Math.max(...f.map(b=>b.position.y+(b.height??0)));c.position.x=d-o,c.position.y=p-o,c.width=g-d+o*2,c.height=m-p+o*2,f.forEach(b=>{b.position.x=b.position.x-c.position.x,b.position.y=b.position.y-c.position.y})}c.parentId&&l.set(c.parentId,[...l.get(c.parentId)??[],c])}),{nodes:s,edges:t}};function QF(){return N.jsx(e2,{children:N.jsx(XF,{})})}const KF=()=>N.jsx(QF,{});/**
|
|
245
245
|
* @license
|
|
246
246
|
* Copyright 2019 Google LLC
|
|
247
247
|
* SPDX-License-Identifier: Apache-2.0
|
|
248
|
-
*/const c2=Symbol("Comlink.proxy"),JF=Symbol("Comlink.endpoint"),WF=Symbol("Comlink.releaseProxy"),pg=Symbol("Comlink.finalizer"),fc=Symbol("Comlink.thrown"),f2=e=>typeof e=="object"&&e!==null||typeof e=="function",eP={canHandle:e=>f2(e)&&e[c2],serialize(e){const{port1:t,port2:n}=new MessageChannel;return h2(e,t),[n,[n]]},deserialize(e){return e.start(),g2(e)}},tP={canHandle:e=>f2(e)&&fc in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},d2=new Map([["proxy",eP],["throw",tP]]);function nP(e,t){for(const n of e)if(t===n||n==="*"||n instanceof RegExp&&n.test(t))return!0;return!1}function h2(e,t=globalThis,n=["*"]){t.addEventListener("message",function r(s){if(!s||!s.data)return;if(!nP(n,s.origin)){console.warn(`Invalid origin '${s.origin}' for comlink proxy`);return}const{id:l,type:o,path:c}=Object.assign({path:[]},s.data),f=(s.data.argumentList||[]).map(Qi);let d;try{const p=c.slice(0,-1).reduce((m,b)=>m[b],e),g=c.reduce((m,b)=>m[b],e);switch(o){case"GET":d=g;break;case"SET":p[c.slice(-1)[0]]=Qi(s.data.value),d=!0;break;case"APPLY":d=g.apply(p,f);break;case"CONSTRUCT":{const m=new g(...f);d=oP(m)}break;case"ENDPOINT":{const{port1:m,port2:b}=new MessageChannel;h2(e,b),d=lP(m,[m])}break;case"RELEASE":d=void 0;break;default:return}}catch(p){d={value:p,[fc]:0}}Promise.resolve(d).catch(p=>({value:p,[fc]:0})).then(p=>{const[g,m]=Fc(p);t.postMessage(Object.assign(Object.assign({},g),{id:l}),m),o==="RELEASE"&&(t.removeEventListener("message",r),p2(t),pg in e&&typeof e[pg]=="function"&&e[pg]())}).catch(p=>{const[g,m]=Fc({value:new TypeError("Unserializable return value"),[fc]:0});t.postMessage(Object.assign(Object.assign({},g),{id:l}),m)})}),t.start&&t.start()}function rP(e){return e.constructor.name==="MessagePort"}function p2(e){rP(e)&&e.close()}function g2(e,t){const n=new Map;return e.addEventListener("message",function(s){const{data:l}=s;if(!l||!l.id)return;const o=n.get(l.id);if(o)try{o(l)}finally{n.delete(l.id)}}),nm(e,n,[],t)}function nc(e){if(e)throw new Error("Proxy has been released and is not useable")}function m2(e){return es(e,new Map,{type:"RELEASE"}).then(()=>{p2(e)})}const Ic=new WeakMap,Bc="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(Ic.get(e)||0)-1;Ic.set(e,t),t===0&&m2(e)});function iP(e,t){const n=(Ic.get(t)||0)+1;Ic.set(t,n),Bc&&Bc.register(e,t,e)}function aP(e){Bc&&Bc.unregister(e)}function nm(e,t,n=[],r=function(){}){let s=!1;const l=new Proxy(r,{get(o,c){if(nc(s),c===WF)return()=>{aP(l),m2(e),t.clear(),s=!0};if(c==="then"){if(n.length===0)return{then:()=>l};const f=es(e,t,{type:"GET",path:n.map(d=>d.toString())}).then(Qi);return f.then.bind(f)}return nm(e,t,[...n,c])},set(o,c,f){nc(s);const[d,p]=Fc(f);return es(e,t,{type:"SET",path:[...n,c].map(g=>g.toString()),value:d},p).then(Qi)},apply(o,c,f){nc(s);const d=n[n.length-1];if(d===JF)return es(e,t,{type:"ENDPOINT"}).then(Qi);if(d==="bind")return nm(e,t,n.slice(0,-1));const[p,g]=k_(f);return es(e,t,{type:"APPLY",path:n.map(m=>m.toString()),argumentList:p},g).then(Qi)},construct(o,c){nc(s);const[f,d]=k_(c);return es(e,t,{type:"CONSTRUCT",path:n.map(p=>p.toString()),argumentList:f},d).then(Qi)}});return iP(l,e),l}function sP(e){return Array.prototype.concat.apply([],e)}function k_(e){const t=e.map(Fc);return[t.map(n=>n[0]),sP(t.map(n=>n[1]))]}const y2=new WeakMap;function lP(e,t){return y2.set(e,t),e}function oP(e){return Object.assign(e,{[c2]:!0})}function uP(e,t=globalThis,n="*"){return{postMessage:(r,s)=>e.postMessage(r,n,s),addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}function Fc(e){for(const[t,n]of d2)if(n.canHandle(e)){const[r,s]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},s]}return[{type:"RAW",value:e},y2.get(e)||[]]}function Qi(e){switch(e.type){case"HANDLER":return d2.get(e.name).deserialize(e.value);case"RAW":return e.value}}function es(e,t,n,r){return new Promise(s=>{const l=cP();t.set(l,s),e.start&&e.start(),e.postMessage(Object.assign({id:l},n),r)})}function cP(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const fP=()=>{const{currentArtifact:e}=Gc();return e?C.jsx("div",{className:"h-full w-full overflow-auto",children:C.jsx("pre",{children:e.code})}):C.jsx("div",{className:"h-full w-full flex items-center justify-center text-gray-500",children:"请选择一个文件"})},dP=()=>{const e=W.useRef(null),[t,n]=W.useState(!1),{currentArtifact:r,getArtifactVersions:s,setCurrentArtifactById:l,artifacts:o}=Gc(),[c,f]=W.useState(0),[d,p]=W.useState("preview"),[g,m]=W.useState(!1),b=async A=>{const S=g2(uP(A.contentWindow));return await Promise.race(Array(100).fill(0).map((O,D)=>new Promise(M=>{setTimeout(async()=>{await S.init()&&M(D)},100*D)}))),S},x=async()=>{if(console.log(c),!!e.current){n(!0);try{await(await b(e.current)).run(r==null?void 0:r.code,r==null?void 0:r.filename,r==null?void 0:r.filetype)}catch(A){console.error("Failed to run code:",A)}finally{n(!1)}}},w=()=>{f(A=>A+1)};if(W.useEffect(()=>{e.current&&x()},[c]),!r)return C.jsx("div",{className:"h-full w-full flex items-center justify-center text-gray-500",children:"请选择一个文件"});const _=s(r.filename),k=Array.from(new Set(o.map(A=>A.filename)));return C.jsxs("div",{className:"h-full w-full flex flex-col",children:[C.jsxs("div",{className:"flex items-center justify-between p-2 border-b",children:[C.jsxs("div",{className:"flex items-center space-x-4",children:[C.jsxs("div",{className:"flex space-x-2",children:[C.jsx("button",{className:`px-3 py-1 rounded ${d==="preview"?"bg-blue-500 text-white":"bg-gray-100 text-gray-700"}`,onClick:()=>{p("preview"),w()},children:"预览"}),C.jsx("button",{className:`px-3 py-1 rounded ${d==="source"?"bg-blue-500 text-white":"bg-gray-100 text-gray-700"}`,onClick:()=>p("source"),children:"源代码"})]}),C.jsxs("div",{className:"relative",children:[C.jsxs("button",{className:"flex items-center space-x-2 px-3 py-1 bg-gray-100 rounded hover:bg-gray-200",onClick:()=>m(!g),children:[C.jsx("span",{children:r.filename}),C.jsx(P3,{className:"w-4 h-4"})]}),g&&C.jsx("div",{className:"absolute top-full left-0 mt-1 w-48 bg-white border rounded-md shadow-lg z-10",children:k.map(A=>{const S=s(A),O=S[S.length-1];return C.jsx("button",{className:"w-full text-left px-3 py-2 hover:bg-gray-100",onClick:()=>{l(O.id),m(!1)},children:A},A)})})]}),C.jsxs("div",{className:"flex items-center space-x-2",children:[C.jsx("span",{className:"text-sm text-gray-500",children:"版本:"}),C.jsx("div",{className:"flex space-x-1",children:_.map(A=>C.jsxs("button",{className:`px-2 py-1 text-sm rounded ${A.id===r.id?"bg-blue-500 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}`,onClick:()=>l(A.id),children:["v",A.version]},A.id))})]})]}),d==="preview"&&C.jsxs("div",{className:"flex space-x-2",children:[C.jsx("button",{disabled:t,className:"px-3 py-1 bg-gray-100 rounded hover:bg-gray-200 disabled:opacity-50",children:t?"Running...":"Run"}),C.jsx("button",{onClick:w,disabled:t,className:"px-3 py-1 bg-gray-100 rounded hover:bg-gray-200 disabled:opacity-50",children:"Refresh"})]})]}),C.jsx("div",{className:"flex-1 overflow-auto",children:d==="preview"?C.jsx("iframe",{ref:e,src:"https://langgraph-artifacts.netlify.app/index.html",className:"w-full h-full border border-gray-300"},c):C.jsx(fP,{})})]})},hP=()=>{const{renderMessages:e,loading:t,inChatError:n,client:r,collapsedTools:s,toggleToolCollapse:l,isFELocking:o}=oa(),c=W.useRef(null),f=W.useRef(null),d=()=>{if(!f.current)return!1;const g=f.current,m=g.scrollTop+g.clientHeight;return g.scrollHeight-m<=50},p=()=>{var g;(g=c.current)==null||g.scrollIntoView({behavior:"instant"})};return W.useEffect(()=>{e.length>0&&f.current&&(t||p(),t&&d()&&p())},[e]),C.jsxs("div",{className:"flex-1 overflow-y-auto overflow-x-hidden p-4",ref:f,children:[C.jsx(gk,{renderMessages:e,collapsedTools:s,toggleToolCollapse:l,client:r}),t&&!o()&&C.jsxs("div",{className:"flex items-center justify-center py-4 text-gray-500",children:[C.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-2 border-blue-500 border-t-transparent mr-2"}),"正在思考中..."]}),n&&C.jsx("div",{className:"p-4 text-sm text-red-600 bg-red-50 rounded-lg border border-red-200",children:JSON.stringify(n)}),C.jsx("div",{ref:c})]})},pP=()=>{const{userInput:e,setUserInput:t,loading:n,sendMessage:r,stopGeneration:s,currentAgent:l,setCurrentAgent:o,client:c,currentChatId:f}=oa(),{extraParams:d}=yk(),[p,g]=W.useState([]),m=_=>{g(k=>[...k,_])},b=_=>{localStorage.setItem("agent_name",_),o(_)},x=()=>{const _=[{type:"human",content:[{type:"text",text:e},...p.map(k=>({type:"image_url",image_url:{url:k}}))]}];r(_,{extraParams:d}),g([])},w=_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),x())};return C.jsxs("div",{className:"border-t border-gray-200 p-4",children:[C.jsxs("div",{className:"flex items-center justify-between mb-4",children:[C.jsx(uL,{onFileUploaded:m}),C.jsx("select",{value:l,onChange:_=>b(_.target.value),className:"px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:c==null?void 0:c.availableAssistants.map(_=>C.jsx("option",{value:_.graph_id,children:_.name},_.graph_id))})]}),C.jsxs("div",{className:"flex gap-2",children:[C.jsx("textarea",{className:"flex-1 p-3 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none",rows:2,value:e,onChange:_=>t(_.target.value),onKeyDown:w,placeholder:"输入消息...",disabled:n}),C.jsx("button",{className:`px-4 py-2 text-sm font-medium text-white rounded-lg focus:outline-none focus:ring-2 focus:ring-offset-2 ${n?"bg-red-500 hover:bg-red-600 focus:ring-red-500":"bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed"}`,onClick:()=>n?s():x(),disabled:!n&&!e.trim()&&p.length===0,children:n?"中断":"发送"})]}),C.jsxs("div",{className:"flex border-b border-gray-200 mt-4 gap-2 justify-between",children:[C.jsx(rm,{usage_metadata:(c==null?void 0:c.tokenCounter)||{}}),C.jsxs("span",{className:"text-sm text-gray-500",children:["会话 ID: ",f]})]})]})},gP=()=>{const[e,t]=W.useState(!1),{showHistory:n,toggleHistoryVisible:r,showGraph:s,toggleGraphVisible:l,renderMessages:o}=oa(),{extraParams:c,setExtraParams:f}=yk(),{showArtifact:d,setShowArtifact:p}=Gc();return C.jsxs("div",{className:"langgraph-chat-container flex h-full w-full overflow-hidden",children:[n&&C.jsx(aL,{onClose:()=>r(),formatTime:BN}),C.jsxs("div",{className:"flex-1 flex flex-col overflow-auto",children:[C.jsxs("div",{className:"flex items-center gap-2 p-4 border-b border-gray-200 justify-end h-16",children:[C.jsxs("button",{className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",onClick:()=>{r(),h1({showHistory:!n})},children:[C.jsx(W3,{className:"w-4 h-4"}),"历史记录"]}),C.jsx("div",{className:"flex-1"}),C.jsx(dL,{}),C.jsxs("button",{onClick:()=>t(!0),className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",children:[C.jsx(YS,{className:"w-4 h-4"}),"编辑参数"]}),C.jsx("button",{className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",onClick:()=>{console.log(o)},children:"打印日志数据"}),C.jsxs("button",{className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",onClick:()=>{l(),h1({showGraph:!s})},children:[C.jsx(az,{className:"w-4 h-4"}),"节点图"]}),C.jsxs("button",{className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",onClick:()=>{localStorage.setItem("code",""),location.reload()},children:[C.jsx(rz,{className:"w-4 h-4"}),"退出登陆"]})]}),C.jsx(hP,{}),C.jsx(pP,{}),C.jsx(cL,{isOpen:e,initialJson:c,onClose:()=>t(!1),onSave:f})]}),(s||d)&&C.jsxs("div",{className:"overflow-hidden flex-1",children:[s&&C.jsx(KF,{}),d&&C.jsx(dP,{})]})]})},mP=()=>C.jsx(Jz,{children:C.jsx(sL,{children:C.jsx(Gz,{children:C.jsx(gP,{})})})}),yP=()=>{const[e,t]=W.useState([{key:"authorization",value:""}]),[n,r]=W.useState(localStorage.getItem("withCredentials")==="true"),[s,l]=W.useState(localStorage.getItem("apiUrl")||""),o=()=>{t([...e,{key:"",value:""}])},c=p=>{t(e.filter((g,m)=>m!==p))},f=(p,g,m)=>{const b=[...e];b[p][g]=m,t(b)},d=()=>{const p=Object.fromEntries(e.map(g=>[g.key,g.value]));localStorage.setItem("code",JSON.stringify(p)),localStorage.setItem("withCredentials",JSON.stringify(n)),localStorage.setItem("apiUrl",s),location.reload()};return C.jsx("div",{className:"min-h-screen bg-gradient-to-br from-gray-50 to-gray-100 flex items-center justify-center p-4",children:C.jsx("div",{className:"w-full max-w-4xl bg-white rounded-2xl shadow-xl overflow-hidden",children:C.jsxs("div",{className:"grid md:grid-cols-2",children:[C.jsx("div",{className:"hidden md:block bg-gradient-to-br from-blue-600 to-blue-800 p-12 text-white",children:C.jsxs("div",{className:"h-full flex flex-col justify-between",children:[C.jsxs("div",{children:[C.jsx("h1",{className:"text-4xl font-bold mb-6",children:"LangGraph UI"}),C.jsx("p",{className:"text-blue-100 text-lg leading-relaxed",children:"专业的 LangGraph 可视化界面,让您的 AI 应用开发更加高效和直观。"})]}),C.jsxs("div",{className:"space-y-4",children:[C.jsxs("div",{className:"flex items-center space-x-3",children:[C.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center",children:C.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})})}),C.jsx("span",{children:"直观的可视化界面"})]}),C.jsxs("div",{className:"flex items-center space-x-3",children:[C.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center",children:C.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),C.jsx("span",{children:"高效的开发体验"})]}),C.jsxs("div",{className:"flex items-center space-x-3",children:[C.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center",children:C.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})}),C.jsx("span",{children:"安全可靠的配置"})]})]})]})}),C.jsxs("div",{className:"p-8 md:p-12",children:[C.jsxs("div",{className:"md:hidden mb-8",children:[C.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"LangGraph UI"}),C.jsx("p",{className:"text-gray-600 mt-2",children:"专业的 LangGraph 可视化界面"})]}),C.jsxs("form",{onSubmit:p=>{p.preventDefault(),d()},className:"space-y-6",children:[C.jsxs("div",{children:[C.jsx("label",{htmlFor:"api-url",className:"block text-sm font-medium text-gray-700 mb-2",children:"API URL"}),C.jsx("input",{type:"text",id:"api-url",value:s,onChange:p=>l(p.target.value),placeholder:"例如: http://localhost:8123",className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all"})]}),C.jsxs("div",{children:[C.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"请求头配置"}),e.map((p,g)=>C.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[C.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[C.jsx("div",{children:C.jsx("input",{type:"text",id:`header-key-${g}`,value:p.key,onChange:m=>f(g,"key",m.target.value),placeholder:"例如: authorization",required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all"})}),C.jsx("div",{children:C.jsx("input",{type:"text",id:`header-value-${g}`,value:p.value,onChange:m=>f(g,"value",m.target.value),placeholder:"例如: Bearer token;无则填 1",required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all"})})]}),g>0&&C.jsxs("button",{type:"button",onClick:()=>c(g),className:"text-red-600 hover:text-red-700 text-sm font-medium flex items-center space-x-1 transition-colors",children:[C.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),C.jsx("span",{children:"删除此请求头"})]})]},g))]}),C.jsxs("div",{className:"flex items-center space-x-3",children:[C.jsx("input",{type:"checkbox",id:"with-credentials",checked:n,onChange:p=>r(p.target.checked),className:"w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),C.jsx("label",{htmlFor:"with-credentials",className:"text-sm text-gray-700",children:"启用 withCredentials(跨域请求时发送 Cookie)"})]}),C.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 pt-4",children:[C.jsxs("button",{type:"button",onClick:o,className:"flex-1 px-6 py-3 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors font-medium flex items-center justify-center space-x-2",children:[C.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),C.jsx("span",{children:"添加请求头"})]}),C.jsxs("button",{type:"submit",className:"flex-1 px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors font-medium flex items-center justify-center space-x-2",children:[C.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),C.jsx("span",{children:"保存配置"})]})]})]})]})]})})})};function bP(){const[e,t]=W.useState(localStorage.getItem("code"));return C.jsx(C.Fragment,{children:e?C.jsx(mP,{}):C.jsx(yP,{})})}RT.createRoot(document.getElementById("root")).render(C.jsx(bP,{}));
|
|
248
|
+
*/const c2=Symbol("Comlink.proxy"),JF=Symbol("Comlink.endpoint"),WF=Symbol("Comlink.releaseProxy"),pg=Symbol("Comlink.finalizer"),fc=Symbol("Comlink.thrown"),f2=e=>typeof e=="object"&&e!==null||typeof e=="function",eP={canHandle:e=>f2(e)&&e[c2],serialize(e){const{port1:t,port2:n}=new MessageChannel;return h2(e,t),[n,[n]]},deserialize(e){return e.start(),g2(e)}},tP={canHandle:e=>f2(e)&&fc in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},d2=new Map([["proxy",eP],["throw",tP]]);function nP(e,t){for(const n of e)if(t===n||n==="*"||n instanceof RegExp&&n.test(t))return!0;return!1}function h2(e,t=globalThis,n=["*"]){t.addEventListener("message",function r(s){if(!s||!s.data)return;if(!nP(n,s.origin)){console.warn(`Invalid origin '${s.origin}' for comlink proxy`);return}const{id:l,type:o,path:c}=Object.assign({path:[]},s.data),f=(s.data.argumentList||[]).map(Qi);let d;try{const p=c.slice(0,-1).reduce((m,b)=>m[b],e),g=c.reduce((m,b)=>m[b],e);switch(o){case"GET":d=g;break;case"SET":p[c.slice(-1)[0]]=Qi(s.data.value),d=!0;break;case"APPLY":d=g.apply(p,f);break;case"CONSTRUCT":{const m=new g(...f);d=oP(m)}break;case"ENDPOINT":{const{port1:m,port2:b}=new MessageChannel;h2(e,b),d=lP(m,[m])}break;case"RELEASE":d=void 0;break;default:return}}catch(p){d={value:p,[fc]:0}}Promise.resolve(d).catch(p=>({value:p,[fc]:0})).then(p=>{const[g,m]=Fc(p);t.postMessage(Object.assign(Object.assign({},g),{id:l}),m),o==="RELEASE"&&(t.removeEventListener("message",r),p2(t),pg in e&&typeof e[pg]=="function"&&e[pg]())}).catch(p=>{const[g,m]=Fc({value:new TypeError("Unserializable return value"),[fc]:0});t.postMessage(Object.assign(Object.assign({},g),{id:l}),m)})}),t.start&&t.start()}function rP(e){return e.constructor.name==="MessagePort"}function p2(e){rP(e)&&e.close()}function g2(e,t){const n=new Map;return e.addEventListener("message",function(s){const{data:l}=s;if(!l||!l.id)return;const o=n.get(l.id);if(o)try{o(l)}finally{n.delete(l.id)}}),nm(e,n,[],t)}function nc(e){if(e)throw new Error("Proxy has been released and is not useable")}function m2(e){return es(e,new Map,{type:"RELEASE"}).then(()=>{p2(e)})}const Ic=new WeakMap,Bc="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(Ic.get(e)||0)-1;Ic.set(e,t),t===0&&m2(e)});function iP(e,t){const n=(Ic.get(t)||0)+1;Ic.set(t,n),Bc&&Bc.register(e,t,e)}function aP(e){Bc&&Bc.unregister(e)}function nm(e,t,n=[],r=function(){}){let s=!1;const l=new Proxy(r,{get(o,c){if(nc(s),c===WF)return()=>{aP(l),m2(e),t.clear(),s=!0};if(c==="then"){if(n.length===0)return{then:()=>l};const f=es(e,t,{type:"GET",path:n.map(d=>d.toString())}).then(Qi);return f.then.bind(f)}return nm(e,t,[...n,c])},set(o,c,f){nc(s);const[d,p]=Fc(f);return es(e,t,{type:"SET",path:[...n,c].map(g=>g.toString()),value:d},p).then(Qi)},apply(o,c,f){nc(s);const d=n[n.length-1];if(d===JF)return es(e,t,{type:"ENDPOINT"}).then(Qi);if(d==="bind")return nm(e,t,n.slice(0,-1));const[p,g]=E_(f);return es(e,t,{type:"APPLY",path:n.map(m=>m.toString()),argumentList:p},g).then(Qi)},construct(o,c){nc(s);const[f,d]=E_(c);return es(e,t,{type:"CONSTRUCT",path:n.map(p=>p.toString()),argumentList:f},d).then(Qi)}});return iP(l,e),l}function sP(e){return Array.prototype.concat.apply([],e)}function E_(e){const t=e.map(Fc);return[t.map(n=>n[0]),sP(t.map(n=>n[1]))]}const y2=new WeakMap;function lP(e,t){return y2.set(e,t),e}function oP(e){return Object.assign(e,{[c2]:!0})}function uP(e,t=globalThis,n="*"){return{postMessage:(r,s)=>e.postMessage(r,n,s),addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}function Fc(e){for(const[t,n]of d2)if(n.canHandle(e)){const[r,s]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},s]}return[{type:"RAW",value:e},y2.get(e)||[]]}function Qi(e){switch(e.type){case"HANDLER":return d2.get(e.name).deserialize(e.value);case"RAW":return e.value}}function es(e,t,n,r){return new Promise(s=>{const l=cP();t.set(l,s),e.start&&e.start(),e.postMessage(Object.assign({id:l},n),r)})}function cP(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const fP=()=>{const{currentArtifact:e}=Gc();return e?N.jsx("div",{className:"h-full w-full overflow-auto",children:N.jsx("pre",{children:e.code})}):N.jsx("div",{className:"h-full w-full flex items-center justify-center text-gray-500",children:"请选择一个文件"})},dP=()=>{const e=W.useRef(null),[t,n]=W.useState(!1),{currentArtifact:r,getArtifactVersions:s,setCurrentArtifactById:l,artifacts:o}=Gc(),[c,f]=W.useState(0),[d,p]=W.useState("preview"),[g,m]=W.useState(!1),b=async A=>{const S=g2(uP(A.contentWindow));return await Promise.race(Array(100).fill(0).map((O,D)=>new Promise(M=>{setTimeout(async()=>{await S.init()&&M(D)},100*D)}))),S},x=async()=>{if(console.log(c),!!e.current){n(!0);try{await(await b(e.current)).run(r==null?void 0:r.code,r==null?void 0:r.filename,r==null?void 0:r.filetype)}catch(A){console.error("Failed to run code:",A)}finally{n(!1)}}},w=()=>{f(A=>A+1)};if(W.useEffect(()=>{e.current&&x()},[c]),!r)return N.jsx("div",{className:"h-full w-full flex items-center justify-center text-gray-500",children:"请选择一个文件"});const _=s(r.filename),k=Array.from(new Set(o.map(A=>A.filename)));return N.jsxs("div",{className:"h-full w-full flex flex-col",children:[N.jsxs("div",{className:"flex items-center justify-between p-2 border-b",children:[N.jsxs("div",{className:"flex items-center space-x-4",children:[N.jsxs("div",{className:"flex space-x-2",children:[N.jsx("button",{className:`px-3 py-1 rounded ${d==="preview"?"bg-blue-500 text-white":"bg-gray-100 text-gray-700"}`,onClick:()=>{p("preview"),w()},children:"预览"}),N.jsx("button",{className:`px-3 py-1 rounded ${d==="source"?"bg-blue-500 text-white":"bg-gray-100 text-gray-700"}`,onClick:()=>p("source"),children:"源代码"})]}),N.jsxs("div",{className:"relative",children:[N.jsxs("button",{className:"flex items-center space-x-2 px-3 py-1 bg-gray-100 rounded hover:bg-gray-200",onClick:()=>m(!g),children:[N.jsx("span",{children:r.filename}),N.jsx(P3,{className:"w-4 h-4"})]}),g&&N.jsx("div",{className:"absolute top-full left-0 mt-1 w-48 bg-white border rounded-md shadow-lg z-10",children:k.map(A=>{const S=s(A),O=S[S.length-1];return N.jsx("button",{className:"w-full text-left px-3 py-2 hover:bg-gray-100",onClick:()=>{l(O.id),m(!1)},children:A},A)})})]}),N.jsxs("div",{className:"flex items-center space-x-2",children:[N.jsx("span",{className:"text-sm text-gray-500",children:"版本:"}),N.jsx("div",{className:"flex space-x-1",children:_.map(A=>N.jsxs("button",{className:`px-2 py-1 text-sm rounded ${A.id===r.id?"bg-blue-500 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}`,onClick:()=>l(A.id),children:["v",A.version]},A.id))})]})]}),d==="preview"&&N.jsxs("div",{className:"flex space-x-2",children:[N.jsx("button",{disabled:t,className:"px-3 py-1 bg-gray-100 rounded hover:bg-gray-200 disabled:opacity-50",children:t?"Running...":"Run"}),N.jsx("button",{onClick:w,disabled:t,className:"px-3 py-1 bg-gray-100 rounded hover:bg-gray-200 disabled:opacity-50",children:"Refresh"})]})]}),N.jsx("div",{className:"flex-1 overflow-auto",children:d==="preview"?N.jsx("iframe",{ref:e,src:"https://langgraph-artifacts.netlify.app/index.html",className:"w-full h-full border border-gray-300"},c):N.jsx(fP,{})})]})},hP=()=>{const{renderMessages:e,loading:t,inChatError:n,client:r,collapsedTools:s,toggleToolCollapse:l,isFELocking:o}=oa(),c=W.useRef(null),f=W.useRef(null),d=()=>{if(!f.current)return!1;const g=f.current,m=g.scrollTop+g.clientHeight;return g.scrollHeight-m<=50},p=()=>{var g;(g=c.current)==null||g.scrollIntoView({behavior:"instant"})};return W.useEffect(()=>{e.length>0&&f.current&&(t||p(),t&&d()&&p())},[e]),N.jsxs("div",{className:"flex-1 overflow-y-auto overflow-x-hidden p-4",ref:f,children:[N.jsx(Nm,{renderMessages:e,collapsedTools:s,toggleToolCollapse:l,client:r}),t&&!o()&&N.jsxs("div",{className:"flex items-center justify-center py-4 text-gray-500",children:[N.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-2 border-blue-500 border-t-transparent mr-2"}),"正在思考中..."]}),n&&N.jsx("div",{className:"p-4 text-sm text-red-600 bg-red-50 rounded-lg border border-red-200",children:JSON.stringify(n)}),N.jsx("div",{ref:c})]})},pP=()=>{const{userInput:e,setUserInput:t,loading:n,sendMessage:r,stopGeneration:s,currentAgent:l,setCurrentAgent:o,client:c,currentChatId:f}=oa(),{extraParams:d}=yk(),[p,g]=W.useState([]),m=_=>{g(k=>[...k,_])},b=_=>{localStorage.setItem("agent_name",_),o(_)},x=()=>{const _=[{type:"human",content:[{type:"text",text:e},...p.map(k=>({type:"image_url",image_url:{url:k}}))]}];r(_,{extraParams:d}),g([])},w=_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),x())};return N.jsxs("div",{className:"border-t border-gray-200 p-4",children:[N.jsxs("div",{className:"flex items-center justify-between mb-4",children:[N.jsx(uL,{onFileUploaded:m}),N.jsx("select",{value:l,onChange:_=>b(_.target.value),className:"px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:c==null?void 0:c.availableAssistants.map(_=>N.jsx("option",{value:_.graph_id,children:_.name},_.graph_id))})]}),N.jsxs("div",{className:"flex gap-2",children:[N.jsx("textarea",{className:"flex-1 p-3 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none",rows:2,value:e,onChange:_=>t(_.target.value),onKeyDown:w,placeholder:"输入消息...",disabled:n}),N.jsx("button",{className:`px-4 py-2 text-sm font-medium text-white rounded-lg focus:outline-none focus:ring-2 focus:ring-offset-2 ${n?"bg-red-500 hover:bg-red-600 focus:ring-red-500":"bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed"}`,onClick:()=>n?s():x(),disabled:!n&&!e.trim()&&p.length===0,children:n?"中断":"发送"})]}),N.jsxs("div",{className:"flex border-b border-gray-200 mt-4 gap-2 justify-between",children:[N.jsx(rm,{usage_metadata:(c==null?void 0:c.tokenCounter)||{}}),N.jsxs("span",{className:"text-sm text-gray-500",children:["会话 ID: ",f]})]})]})},gP=()=>{const[e,t]=W.useState(!1),{showHistory:n,toggleHistoryVisible:r,showGraph:s,toggleGraphVisible:l,renderMessages:o}=oa(),{extraParams:c,setExtraParams:f}=yk(),{showArtifact:d,setShowArtifact:p}=Gc();return N.jsxs("div",{className:"langgraph-chat-container flex h-full w-full overflow-hidden",children:[n&&N.jsx(aL,{onClose:()=>r(),formatTime:BC}),N.jsxs("div",{className:"flex-1 flex flex-col overflow-auto",children:[N.jsxs("div",{className:"flex items-center gap-2 p-4 border-b border-gray-200 justify-end h-16",children:[N.jsxs("button",{className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",onClick:()=>{r(),p1({showHistory:!n})},children:[N.jsx(W3,{className:"w-4 h-4"}),"历史记录"]}),N.jsx("div",{className:"flex-1"}),N.jsx(dL,{}),N.jsxs("button",{onClick:()=>t(!0),className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",children:[N.jsx(XS,{className:"w-4 h-4"}),"编辑参数"]}),N.jsx("button",{className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",onClick:()=>{console.log(o)},children:"打印日志数据"}),N.jsxs("button",{className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",onClick:()=>{l(),p1({showGraph:!s})},children:[N.jsx(az,{className:"w-4 h-4"}),"节点图"]}),N.jsxs("button",{className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",onClick:()=>{localStorage.setItem("code",""),location.reload()},children:[N.jsx(rz,{className:"w-4 h-4"}),"退出登陆"]})]}),N.jsx(hP,{}),N.jsx(pP,{}),N.jsx(cL,{isOpen:e,initialJson:c,onClose:()=>t(!1),onSave:f})]}),(s||d)&&N.jsxs("div",{className:"overflow-hidden flex-1",children:[s&&N.jsx(KF,{}),d&&N.jsx(dP,{})]})]})},mP=()=>N.jsx(Jz,{children:N.jsx(sL,{children:N.jsx(Gz,{children:N.jsx(gP,{})})})}),yP=()=>{const[e,t]=W.useState([{key:"authorization",value:""}]),[n,r]=W.useState(localStorage.getItem("withCredentials")==="true"),[s,l]=W.useState(localStorage.getItem("apiUrl")||""),o=()=>{t([...e,{key:"",value:""}])},c=p=>{t(e.filter((g,m)=>m!==p))},f=(p,g,m)=>{const b=[...e];b[p][g]=m,t(b)},d=()=>{const p=Object.fromEntries(e.map(g=>[g.key,g.value]));localStorage.setItem("code",JSON.stringify(p)),localStorage.setItem("withCredentials",JSON.stringify(n)),localStorage.setItem("apiUrl",s),location.reload()};return N.jsx("div",{className:"min-h-screen bg-gradient-to-br from-gray-50 to-gray-100 flex items-center justify-center p-4",children:N.jsx("div",{className:"w-full max-w-4xl bg-white rounded-2xl shadow-xl overflow-hidden",children:N.jsxs("div",{className:"grid md:grid-cols-2",children:[N.jsx("div",{className:"hidden md:block bg-gradient-to-br from-blue-600 to-blue-800 p-12 text-white",children:N.jsxs("div",{className:"h-full flex flex-col justify-between",children:[N.jsxs("div",{children:[N.jsx("h1",{className:"text-4xl font-bold mb-6",children:"LangGraph UI"}),N.jsx("p",{className:"text-blue-100 text-lg leading-relaxed",children:"专业的 LangGraph 可视化界面,让您的 AI 应用开发更加高效和直观。"})]}),N.jsxs("div",{className:"space-y-4",children:[N.jsxs("div",{className:"flex items-center space-x-3",children:[N.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center",children:N.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})})}),N.jsx("span",{children:"直观的可视化界面"})]}),N.jsxs("div",{className:"flex items-center space-x-3",children:[N.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center",children:N.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),N.jsx("span",{children:"高效的开发体验"})]}),N.jsxs("div",{className:"flex items-center space-x-3",children:[N.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center",children:N.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})}),N.jsx("span",{children:"安全可靠的配置"})]})]})]})}),N.jsxs("div",{className:"p-8 md:p-12",children:[N.jsxs("div",{className:"md:hidden mb-8",children:[N.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"LangGraph UI"}),N.jsx("p",{className:"text-gray-600 mt-2",children:"专业的 LangGraph 可视化界面"})]}),N.jsxs("form",{onSubmit:p=>{p.preventDefault(),d()},className:"space-y-6",children:[N.jsxs("div",{children:[N.jsx("label",{htmlFor:"api-url",className:"block text-sm font-medium text-gray-700 mb-2",children:"API URL"}),N.jsx("input",{type:"text",id:"api-url",value:s,onChange:p=>l(p.target.value),placeholder:"例如: http://localhost:8123",className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all"})]}),N.jsxs("div",{children:[N.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"请求头配置"}),e.map((p,g)=>N.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[N.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[N.jsx("div",{children:N.jsx("input",{type:"text",id:`header-key-${g}`,value:p.key,onChange:m=>f(g,"key",m.target.value),placeholder:"例如: authorization",required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all"})}),N.jsx("div",{children:N.jsx("input",{type:"text",id:`header-value-${g}`,value:p.value,onChange:m=>f(g,"value",m.target.value),placeholder:"例如: Bearer token;无则填 1",required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all"})})]}),g>0&&N.jsxs("button",{type:"button",onClick:()=>c(g),className:"text-red-600 hover:text-red-700 text-sm font-medium flex items-center space-x-1 transition-colors",children:[N.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),N.jsx("span",{children:"删除此请求头"})]})]},g))]}),N.jsxs("div",{className:"flex items-center space-x-3",children:[N.jsx("input",{type:"checkbox",id:"with-credentials",checked:n,onChange:p=>r(p.target.checked),className:"w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),N.jsx("label",{htmlFor:"with-credentials",className:"text-sm text-gray-700",children:"启用 withCredentials(跨域请求时发送 Cookie)"})]}),N.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 pt-4",children:[N.jsxs("button",{type:"button",onClick:o,className:"flex-1 px-6 py-3 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors font-medium flex items-center justify-center space-x-2",children:[N.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),N.jsx("span",{children:"添加请求头"})]}),N.jsxs("button",{type:"submit",className:"flex-1 px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors font-medium flex items-center justify-center space-x-2",children:[N.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),N.jsx("span",{children:"保存配置"})]})]})]})]})]})})})};function bP(){const[e,t]=W.useState(localStorage.getItem("code"));return N.jsx(N.Fragment,{children:e?N.jsx(mP,{}):N.jsx(yP,{})})}RT.createRoot(document.getElementById("root")).render(N.jsx(bP,{}));
|